CSS - Problem With Fieldset & Legend (overlapping Background)
Hello!
I am using some pretty simple css to format a form for my website. I really like the way using Fieldset & Legend allows for quick and easy formatting of the form but I have one small problem. When I give the fieldset a background it goes above the border of the legend and doesn't look right. I've seen forms that have worked around this problem but I'm not sure how. Any suggestions or help would be appreciated! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <title>ALE Join Form</title> <head> <style type="text/css"> fieldset { border: 2px solid #87AFC7; width: 50%; background: #F5F5F5; } legend { color: #fff; background: #87AFC7; border: 1px solid #fff; padding: 2px 6px } </style> </head> <body> <form action="#" method="post"> <fieldset> <legend>ALE Membership</legend><br><br> <!-- Provide a dropdown menu option field with sauces. --> <input type="hidden" name="on0" value="Type">Type of Sauce <select name="os0"> <option value="Select a type">-- Select a type --</option> <option value="Red">Red sauce</option> <option value="Green">Green sauce</option> </select></p> <br /> <!-- Provide a dropdown menu option field with prices. --> <input type="hidden" name="on1" value="Size">Size <select name="os1"> <option value="06oz">6 oz. bottle - $1.00 USD</option> <option value="12oz">12 oz. bottle - $2.00 USD</option> <option value="36oz">3 12 oz. bottles - $3.00 USD</option> </select></p> <br /> <!-- Display the payment button. --> <input type="submit" name="submit" value="submit" /><br><br> </fieldset> </form><br><br> <fieldset> <legend>Thank You</legend> <center> <p>Your something is complete!</p><br> </center> </fieldset> </body> </html> Below is a link to a terrible picture of the form (sorry it's not online): http://www.leadershipeducators.org/redesign/images/users/Jared/profile.jpg Similar TutorialsJust wondering if there are any css tags that would be able to produce a fieldset/legend look like this... The idea of being able to get a link to show up on the right side there is what i'm trying for. thanks for reading... Hi Guys, I'm trying to figure out if a certain formatting is available for Fieldsets, specifically, the legend styling. In the fieldset, the legend is typically displayed in the top left corner of the fieldset. I'm wanting to have TWO legends. One in the top left, and one in the top right. Here's two examples. A normal one, and one with two legends that I would like. (i photoshopped the 2nd one). Is this possible? Not the best title, but I couldn't think of a better way to describe what I am trying to do. I currently use css to position form elements and their labels nicely without the use of tables. I now want to be able to add fieldset tags, encapsulating a bunch of radio or checkboxes, and a legend tag, and have that legend tag appear exactly as my current label tags do. Easier to look at the demo page I think: http://markdw.com/formTest.html Looks fantastic in FF, almost perfect in IE, but not so good in Safari (all on a PC). I can fix the positioning of the fieldset in Safari by removing the top:-18px and margin-top:-18px styles, but no matter what I do I cannot get the LEGEND to show up on the page. The same applies to IE6 I just noticed. a) I hope the code is useful and/or interesting to others, and b) I hope someone will be able to help me with the safari issue Many thanks. been tearing my hair out with this problem I've been doing an expanding menu for drupal and functionally it works perfect. You click on the legend, it expands the fieldset. However I'm having major difficulties on the CSS side of things. The problem is that when I adjust the height of the legend to fit the background image, it doesn't push the other fieldsets down in IE 7 and 8 but it does in Firefox and (oddly) IE6. Given that means a ~20 pixel gap between menu items in Firefox compared to none in IE7,8 it means the menu always looks ugly in one of the two sets of browers. Here's the CSS in question (displays ok in IE7,8 but spaced out in FF): Code: fieldset.accordian { border:none; margin-top:8px; padding-bottom:3px; width:205px; } legend { background-image: url('images/menubg.png'); background-repeat: no-repeat; margin:0; padding:0; width:205px; line-height:37px; height:37px; } i really like the fieldset due to having the title in the middle of the border, but are there any cross-browser issues? also what i'm finding is that if i set background styling. IE sets the background colour to include the legend aswell, whereas Firefox sets the background colour to the confines of the border. Ideas welcome and asked for Effective Alternatives also welcomed I'm trying to adapt a technique I saw on matthewjamestaylor 's website to a design for my site that involves overlapping divs with background images. I can't get one of them to show up, and I'm not sure why? I'm using nested divs to get equal column heights. I need different background images on a number of elements. Here's the overall structu <body> - has an image background that repeats. <wrapper> - has an image background that repeats. <header> <navbar> - has a background image that doesn't repeat. </navbar> <banner> </banner> </header> <colmask> <colright> <content> <main> - has a background image that doesn't repeat. </main> <sidebar> - has a background image that doesn't repeat. </sidebar> </content> </colright> </colmask> <footer> - has a background image that doesn't repeat. </footer> </wrapper> </body> I also need a background image on either colmask, colright, or content as well, and it's not showing up! I can't figure out why. It's a border image that should show up between the sidebar background and the main content background. Any idea why it's not expanding to fill it? I'm uploading my site to elenmir dot com / themes / elenmir / default dot html Thanks Hey guys, I'm new to the forums and would appreciate any help... I've never used fieldsets before, until now, and check out: http://www.koofers.com/contact.php A horizontal bar shows up in IE... and the globe in the top right of the screen goes off the monitor! And in FireFox, if I add bullet points to the content, the text actually goes outside of the fieldset. I know now the more I read that fieldsets are pretty much just for forms and such, but I really like the cool effect they give! And yes, I know... I shouldn't be using tables for my design, I should be doing crazy sweet things in CSS, but I'm still learning and don't have the time to totally re-design it in CSS (even if I could get it working!) Any help would be appreciated. Hi Everyone, I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm really confused as to what is going on in IE. FF renders the page exactly as I expect. IE renders the page with everything in the correct location, but it seems to double the background image for a sub-div section that is moved up using a negative margin (#menu { ... margin-top: -200px; ... }). Also, this "duplicate background" seems to "flicker" on and off in certain areas, but part of it is always there. (I think there may be more than one duplicate?) To view what's happening, check it out in FF, and then in IE: example.com/HTML example.com/CSS I have very little code, and I'm not sure what is the relevant part: CSS: Code: .logo_banner { background-image:url(../images/new/logo_web1.png); background-repeat:no-repeat; background-position:left top; height:188px; } .spacer { height:10px; } .spacer_10px { height:10px; } .spacer_40px { height:40px; } .spacer_50px { height:50px; } .spacer_separator { height:1px; background-image:url(../images/bg_separator.png); background-repeat:repeat-x; background-position:center top; } #menu { height:50px; margin-left:200px; margin-top:-80px; } #home_btn { background-image:url(../images/new/home_btn_web.png); background-repeat:no-repeat; background-position:left; height:50px; } #home1_btn { background-image:url(../images/new/home_btn_web.png); background-repeat:no-repeat; background-position:left; height:50px; margin-left:120px; margin-top:-50px; } #home2_btn { background-image:url(../images/new/home_btn_web.png); background-repeat:no-repeat; background-position:left; height:50px; margin-left:240px; margin-top:-50px; } #home3_btn { background-image:url(../images/new/home_btn_web.png); background-repeat:no-repeat; background-position:left; height:50px; margin-left:360px; margin-top:-50px; } #home4_btn { background-image:url(../images/new/home_btn_web.png); background-repeat:no-repeat; background-position:left; height:50px; margin-left:480px; margin-top:-50px; } .spacer_dotted_line { background-image:url(../images/new/dotted_line.png); background-repeat:repeat-x; width:860px; height:2px; margin-left:auto; margin-right:auto; } .div_body_top { background-image:url(../images/backgrounds/bg_dark_body_top1.png); width:900px; height:20px; background-repeat:no-repeat; } .div_body_middle { background-image:url(../images/backgrounds/bg_dark_body_middle1.png); height:auto; background-repeat:repeat-y; padding-left:20px; padding-right:20px; } .div_body_bottom { background-image:url(../images/backgrounds/bg_dark_body_bottom1.png); width:900px; height:20px; background-repeat:no-repeat; } .footer_bar { background-color:#2B2D20; height:60px; text-align:center; } .footer_text { font-family:Geneva, Arial, Helvetica, sans-serif; font-size:10px; color:#FFFFFF; line-height:60px;} .text_style_body { text-align:left; font-family:Geneva, Arial, Helvetica, sans-serif; color:#CECECE; font-size:10px; } .content_body { height:auto; width:900px; margin-left:auto; margin-right:auto; } .text_area { padding-top:10px; padding-left:20px; padding-right:20px; padding-bottom:20px; width:860px; margin-left:auto; margin-right:auto; } And here is the HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test Page 1</title> <link href="styles/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <div class="content_body"> <div class="div_body_top"></div> <div class="div_body_middle"> <div class="logo_banner"></div> <div id="menu"> <div id="home_btn"></div> <div id="home1_btn"></div> <div id="home2_btn"></div> <div id="home3_btn"></div> <div id="home4_btn"></div> </div> <div class="spacer_10px"></div> <div class="spacer_dotted_line"></div> <div class="spacer_40px"></div> <div class="text_style_body"> Here is some content. Love that content. One day this text will actually say something. ... <br/> <br/> Here is some content. Love that content. One day this text will actually say something. Here is some content. Love that content. One day this text will actually say something. Here is some content. Love that content. One day this text will actually say something. ... </div> <div class="spacer_50px"></div> <div class="spacer_40px"></div> </div> <div class="div_body_bottom"></div> </div> <div class="spacer"> </div> <div class="footer_bar footer_text">Copyright 2008</div> </div> </body> </html> Any help is GREATLY appreciated. Thanks! Hi, I have been a CSS/XHTML developer for about 6 months now and I just came accross a problem that I have had difficulty solving... I have spent about a week on this problem, and still no luck... I kind of restarted too with no luck... I am thinking this may be a bug... But it works fine in IE... In firefox, the content division background does not continue, instead a footer background is moved up... This is so weird, I dont know how this can be possible... This has been extremely frustrating... If anyone can help, that would be great! Thanks a lot! Could you take a look at www.tscweb.co.uk/contact.php? I do not want the bottom slogan DIV to overlap the form on the right. TIA, Terry Hi, Code: <a href="..." ><span class='openP'></span>Open this section</a> <style type="text/css"> span.openP{ background-image:url('images/plus.gif'); background-repeat:no-repeat; width:50px; background-position:left center;} </style> Why does "Open this section" text appears over the image 'images/plus.gif'? How do I make 'plus.gif' to be left or right to the text? Hi, I've created a page with two tables, which is basically structured like <table> main content </table> <table id="footer"> footer content </table> and in my style sheet i have Code: #footerid { position: absolute; bottom: 0px; } The problem is that the footer is overlapping the content if the content is greater then a page's length. What I need is for the footer to come after the content table insetad of overlapping as it is now. Does this require some sort of id attached the first table? Thanks for any help on this one Got a problem in ie6 with divs dropping and a slight over lap in ie7. The tables are set width inside a 600px wide div but no matter what i do the columns on the right keep dropping. anyone have any ideas? how can i post screenshots when no urls allowed? I am having a heck of a time dealing with IE7 and how it handles z-index tags on SELECT elements and DIV's. This problem only exists in IE7 and does not manifest in IE6, Firefox (Mac/Win) or Safari (Mac/Win). I've posted a concise example of my problem on one of my servers to better illustrate my problem: Sample Problem Page. Check it out using IE6 and then using IE7. Or if you don't have IE6, I've posted a screenshot of what it looks like. I would appreciate any help solving this problem for IE7. Feel free to copy the source code and play with it and even keep the combo-box drop down code for your own use (if you help me get it working of course, ha ha). I've worked out most css problems but I can't find any css that will make the drop down menu on my site sit on top of the YouTube video that you can see he www the-bizness .co. .uk If you click on Home Page or Multimedia the drop-down menu is behind the video clip. Very annoying. Any help appreciated! Within the LEGEND tag, how would I position the radio buttons to the far right? I thought something like the following would work, but wasn't sucessful. .radios {text-align: right;} Thanks Code: <fieldset> <legend> Some Text <select><option value="1">One</option><option value="2">Two</option></select> <span class="radios"> <input type="radio" name="r" id="r" value="1">one <input type="radio" name="r" id="r" value="2">two </span> </legend> <table> <tr><td>bla</td><td>bla</td></tr> <tr><td>bla</td><td>bla</td></tr> <tr><td>bla</td><td>bla</td></tr> </table> </fieldset> Hi guys, sorry if its newbie question, don't work with CSS so long. I've just read a nice article about styling CSS forms (Fancy Form Design) and it looked really nice, so I tried to apply it immediately. However, some problems occured, things are never so easy I guess . First problems occurs with styling of group of form elements: they are dropped one line down (below its label, resp. legend) in IE 5.5/6.0 and also moved to the right (in IE 5.5-7.0) for some reason. Also, styling of fieldsets' legends works odd: first legend is styled differently than the others (one would guess that all of them will be styled in same way). Could you give me pls a little hint on these problems? Here's the test page with applied form styling: http://147.32.122.251/hsh2t/index.php. General CSS: http://147.32.122.251/hsh2t/forms.css IE (5.5-6.0) only CSS: http://147.32.122.251/hsh2t/forms-ie.css So I have a design where the background is a large (1400x1100) image that fades into a vertical gradient at the edges. I've set up the css as follows: body { background: #000 url(gradient.jpg) repeat-x; margin: 0; } Here's where I run into my problem... I've created an empty DIV to hold the large image which will appear on top of the gradient and positioned it absolutely. <div id="bg_image"></div> #bg_image { width: 100%; height: 1100px; background: url(images/bg_image.jpg) no-repeat top center; margin: 0; position:absolute; } This works and the background looks like it should, however because the large image is inside a DIV, any time the browser window is smaller than that div (which will be the case for most users considering the image size) there will be scrollbars. This makes perfect sense of course I just can't come up with an alternative. If there was a way to extend a background image beyond the borders of a DIV that would work but overflow:visible; doesn't seem to work with background images only content. I wish I could set a repeating background AND a static background in the body style, because that is exactly the effect I'm trying to achieve. Any suggestions would be greatly appreciated! Thanks, Josh does fieldset have a width attribute rather than having it spread across the whole screen or should i just put it inside a DIV tag? |