CSS - Problems With: Padding ( I Think ), Hovering And Size Of Textarea.
Hello again. Or should I say ( Time on my watch is 22:17 and because of time zones (+7 for US) ) good morning ?
If go to the: http://www.odin.foxnet.pl/archives.html and expand these 2 menus : Navigation and Other - You will see my problem, and it was working before, now it looks, just like you can see. Second problem: solved And at the ending: Fileds for name and mail for comment wasn't so bad as now. Just look at it (2 eg: http://www.odin.foxnet.pl/2005/09/14/Tales/mj-przyszy-bokken.html http://www.odin.foxnet.pl/2005/09/15/Home/userfriendly-url.html ) Goodnight everyone. You are great people, offering great help. milosz-odin - known from this weigher Similar TutorialsI'm having trouble adding padding to a text area without affecting the scrollbar. I would like the padding:10px to only be around text in the textarea without making the scrollbar have padding around it. Is this possible? Thanks I'm using the following code below to try and get a CSS template that I can use on sites to make them as consistent as possible across browsers. I've done fairly well (I think), but I'm having trouble with odd stubborn space around textarea's and other form elements. Any suggestions on how to remove these margins/padding? Both CSS and HTML is validated OK. Code: /* CSS Document */ /* TAG DEFAULTS */ HTML { font-size:100%; /* IE correction */ /* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */ height:100%; margin-bottom:1px; color:#352819; font-family:"Times New Roman", Times, serif; } BODY { /* Text-Sizing with ems: (URL address blocked: See forum rules) */ font-size:1em; background-color:#FFFFFF; margin:0; } TABLE { font-size:100%; /* IE correction */ border-collapse:collapse; border:0px none; } H1, H2, H3, H4, H5, H6, P, BLOCKQUOTE { margin:5px 0 10px; line-height:100%; } H1 {font-size:2em;} H2 {font-size:1.5em;} H3 {font-size:1.25em;} H4 {font-size:1em;} H5 {font-size:.75em;} H6 {font-size:.55em;} INPUT, SELECT, TEXTAREA, TH, TD { font-size:1em; font-family:"Times New Roman", Times, serif; margin:0; padding:0; } INPUT, SELECT, TEXTAREA { border:1px solid #352819; } TEXTAREA { overflow: auto; width:300px; height:100px; } FORM, LI {margin:0;} UL {list-style-type:disc;} LI LI, LI P, TD P, BLOCKQUOTE P {font-size:1em} OL, UL { margin:0; padding:0; padding-left:23px; } A:LINK {color:#a47832;} A:VISITED {color:#a47832;} A:HOVER {color:#e5a135;} /* END TAG DEFAULTS */ Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Style Test</title> <link href="css/style.css" rel="stylesheet" type="text/css"> </head> <body> <table> <tr><th>Cell TH 1</th><th>Cell TH 2</th></tr> <tr><td>Cell TD 3</td><td>Cell TD 4</td></tr></table> <h1>This is H1</h1> <h2>This is H2</h2> <h3>This is H3</h3> <h4>This is H4</h4> <h5>This is H5</h5> <h6>This is H6</h6> <p>This is P</p> <UL> <LI>List Item 1</LI> <LI>List Item 2 Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped</LI> <LI>List Item 3</LI> </UL> <OL> <LI>List Item 1</LI> <LI>List Item 2 Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped</LI> <LI>List Item 3</LI> </OL> <form action=""> <div><input value="Input" name="name" type="text"><input value="Input" name="name" type="text"><br> <input value="Input" name="name" type="text"><br> <input value="Input" name="name" type="text"> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select><br> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <textarea name="myarea" cols="100" rows="5">This is my text area</textarea><textarea name="myarea" cols="100" rows="5">This is my text area</textarea><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <textarea name="myarea" cols="100" rows="5">This is my text area</textarea><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <input type=submit name=submit value="My Button"> <input type=submit name=submit value="My Button"><br> <input type=submit name=submit value="My Button"> </div></form> <div><a href="contact.shtml">Hyperlink</a></div> <blockquote><div>This is a blcokquote This is a blcokquote This is a blcokquote This is a blcokquote</div></blockquote> </body> </html> Hi... I'm trying to make a div that is exact in its dimensions. So for example... PHP Code: // the style definition .test { background-color: #cccccc; width: 100px; height: 20px; padding-left: 20px; } // the body of the html document <div class="test">My test</div> Now with this style definition, I would expect that the size of the div box will be the same even if I commented out the padding-left line... because that is just padding, not the width! But amazingly enough, the padding adds to the width of the box. And in order to get the width of the box back to 100px, I have to subtract the padding from the width... so that I would have to change width to 80px in order for the box to still be 100px wide. Any ideas why this is the case? It seems very counterintuitive to me and I know that I can always change the width to make it look right again, but it feels wrong and it very sloppy. Is there an elegant way to do this? Thanks hello is it possible to use css or some other artifice to make textarea/input elements adjust their row/col/size when the user increases/decreases the font size? i'm mostly talking about IE, because netscape/etc. seem to work it out just fine... setting a relative font-size for textarea/input elements on the stylesheet doesn't seem to do the trick. as usual, i tried looking around for info on this but found none, i'm beginning to think it just can't be done. any help would be really appreciated Hello all! I'm having an odd problem. I have a select box and a textarea right next to each other that need to be the exact same dimensions. I figure, easy, just set the height and width via CSS properties, but that doesn't seem to be accurate at all - in either browser. I got out a neat program called pixel ruler to see exactly how many pixels each is displayed with. This is what happens: ie - Not counting borders, the textarea is the exact width and height. The select box is correct width (not counting the border. If you include the 1px standard blue border on any of these, they are 2px too wide or tall). However, the height of the select box(very annoying) seems to be somewhat ignored in that ie forces the select box to end at the end of a row, so giving it a height will just approximate a row number. It would be nice if I could fix this. Any thoughts on that? firefox- Not including the border, the select box is 2px too few in both the width and height. If you include the border it is exact. (which means that ie and ff are going to be hard to match.) But here is the REAL puzzler and the biggest reason for the post. Firefox seems to get the textarea size completely wrong. Not including the border, it is 2px too wide and tall! If you include the border, it is then 4px too wide and tall. I have no padding or margins on these by the way, so that can't be the answer. Any thought as to why firefox is putting extra width and height on textareas? Or any suggestions on making a textarea and select the same size in both ff and ie? Thanks! Having a strange problem with textarea font sizes in Firefox (1.06) See here - http://www.4L.ie/contact.php Text entered in the text fields is appearing correctly, but when entering text into the "Your Query" textarea, the font-size is noticeably smaller and less legible. It appears fine in IE6. My CSS relating to fonts is as follows: Code: body { font: 76% verdana, arial, helvetica, sans-serif; } input, select, textarea { font-size: 1em; } If I use pixels (ie font-size: 12px) there is no problem. Ems and % seems to mess things up. Anybody able to shed some light on this? A possible bug in Firefox 1.06? Thanks in advance. I have a beautiful looking site when viewed in Firefox but I am having some problems with Internet Explorer (surprise, surprise!) http://cbo4edu.org/newSite/index.html I want the Headings, OUR MISSION and CBO NEWS to be lined up just below the navigation div. In Firefox, my CSS and padding renders perfectly, with the background on OUR MISSION blending in with the navigation div's bottom border. In IE, these headings are mostly hidden behind the navigation div. How can I adjust my CSS for IE without disturbing the Firefox version? I am creating a web page using CSS, and having a hard time with IE vs Netscape. IE ignores padding in defining width, and Netscape includes it. So, my page design is correct in one browser or the other. Does anyone know a way around this problem? Hi, beeing fairly new to CSS I am having a hard time solving this issue, hopefully it has a simple solution which someone might help me with. Here goes, In IE this page aligns nicely at the top of the browser window just like I want it to, but in FF and Opera the whole page is moved down maybe 5px or so, the code is pasted below. Also, it seems to me that IE stacks the layers tighter, bordder to border, than FF and Opera which seems to add padding or margin to the layers. I am probably way off but I would be extremely happy for any help. 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" lang="en"> <head> <style type="text/css"> html{ margin:0px; padding:0px; } body { background: #FFF; margin:0px; padding:0px; font-family: Arial, Helvetica, sans-serif; font-size:62.5%; text-align:center; /*fix for centering the content div for IE 5.5*/ } #content { width:748px; margin:0px auto; padding:0px; text-align:left; /*IE 5.5 alignment fix*/ } #tipsHeader{ height:113px; background:#FFF url(images/Logo.gif) no-repeat top left; margin:0px; padding:0px; } #tipsHeader h1 span { display:none; margin:0px; padding:0px; } #bigProdDisplay{ width:448px; height:298px; text-align:left; float: left; } #productSlogan{ width:300px; height:298px; background: #FFF url(images/squareHeaderParotid.gif) no-repeat top left; margin:0px; padding:0px; text-align:right; float: right; } #productSlogan h3 span { display:none; } /*==========NAV STYLES============*/ #navcontainer{ margin-bottom:25px; } #navcontainer ul { padding-left: 0px; margin-left: 0px; background-color: #fff; float: left; width: 100%; font-family: Verdana, arial, helvetica, sans-serif; } #navcontainer ul li { display: inline; } #navcontainer ul li a { padding: 0.2em 1.2em; background-color: #fff; color: #4E5C8D; text-decoration: none; float: left; font-size: 1.2em; font-weight: normal; } #navcontainer ul li a:hover { background-color: #fff; color: #F66; font-size: 1.2em; border-bottom-width: 3px; border-bottom-style: solid; border-bottom-color: #F66; } #home #navlist-home a, #advantages #navlist-advantages a, { color: #F66; font-size: 1.2em; border-bottom-width: 3px; border-bottom-style: solid; border-bottom-color: #F66; } #home #navlist-home a:hover, #advantages #navlist-advantages a:hover, { text-decoration: none; } #navlist a:active { color: #333; font-size: 1.2em; border-bottom-width: 3px; border-bottom-style: solid; border-bottom-color: #F66; } /*======END NAV STYLES======*/ </style> </head> <body id="home"> <div id="content"> <div id="tipsHeader"><h1><span>Header text</span></h1></div> <div id="bigProdDisplay"><img src="images/BigSmall.jpg" alt="" /></div> <div id="productSlogan"><h3><span>mighty slogan hides behind image</span></h3></div> <div id="navcontainer"> <ul id="navlist"> <li id="navlist-home"><a href="#">HOME</a></li> <li id="navlist-advantages"><a href="#">ADVANTAGES</a></li> <li id="navlist-application"><a href="#">APPLICATION</a></li> <li id="navlist-conventions"><a href="#">CONVENTIONS</a></li> <li id="navlist-contact"><a href="#">CONTACT US</a></li> <li id="navlist-references"><a href="#">REFERENCES</a></li> </ul> </div> </div> </body> </html> Hi, The site I'm developing is: http://www.jaysonsgroup.com/index2.html It's only a temporary page..some old <table> tags are in there..which don't validate as XHTML. But, I come across many IE 5.0 - related problems for many of my sites..i.e. even those that validate under W3C etc. So I'm just asking generally, does anyone know a site that has fixes for IE 5.0 bugs? My sites seem to be fine on most browsers except this one. In regard to the above link, I had some major problems with IE 5.0 on the middle area (i.e. the images & text under "news" and "login"). The basic HTML code for that: Code: <div class="outerblock"> <div class="news"> <div class="news_left"><div class="news_left_text">My text</div></div> <div class="news_mid"><img src='images/sinhala.gif' width='431' height='286' alt='' /></div> </div> <div class="login_right"> my login table </div> </div> and the CSS for that: Code: .outerblock { width: 100%; overflow:hidden; display: block; clear: both; } .news { width: 607px; overflow:hidden; float: left; border-right: 1px solid #C5C5DD; } .news_left { width: 163px; float: left; overflow:auto; display: block; background: url(../images/home_worldwide.gif) no-repeat; padding: 110px 0px 0px 0px; } .news_left_text { padding: 0px 0px 0px 5px; color: #3B537D; font-family: Verdana, Arial ; font-size:7.5pt ; font-weight:normal; line-height: 13px; } .news_mid { width: 440px; height: 300px; float: left; overflow:hidden; } .login_right { width: 160px; height: 250px; padding: 50px 0px 0px 0px; float: left; background: #ECEDF2; border-right: 1px solid #C5C5DD; border-left: 2px solid #FFFFFF; overflow: hidden; } One problem I had (on IE 5.0) was that the middle 'news_mid' image was overflowing, positioned just below the 'news_left' area. The widths etc are all correct because the container width is 771px. So the entire area should just fit and not overflow (even though in IE 5.0 it did). The 'news' overflow property was AUTO, and I fixed the problem by specifying the overflow:hidden. Likewise, the 'login_right' div was overflowing just below the entire news section, and not to the right as it should have been. Once again I fixed this by specifying overflow:hidden for the outer div. Is it common to use overflow:hidden for things like this? Or is there a more appropriate fix? Another small problem I noticed for IE 5.0 : http://www.jaysonsgroup.com/ie5win.jpg (screenshot). The login_right background does not extend all the way. The height of the div should be 250 pixels + 50pixels on the padding - so 300 pixels total. But IE 5.0 ignores the 50pixels padding and leaves the background with a height of 250px. Thanks very much in advance! Hi all, I have a horizontal navbar using the old favourite ul/li html list with css doing the layout. Problem is that there is a difference of display between firefox and ie7. The li tag css is Code: li{ background:url('../images/li_bg.gif') repeat-x #ff0000; display:inline; padding:0 5px 0 5px; margin:0 2px 0 0; } List html is: Code: <ul> <li><a href="member.php">Home</a></li> <li><a href="profile.php">Profile</a></li> <li><a href="help.php">Help</a></li> <li><a href="logout.php">Logout</a></li> </ul> I reset margin and padding for all other tags in a general css file. The image is a 1px width gradient. Looks fine on ie7 but firefox seems to add an extra 2 or 3 pixels of margin. Used firebug to try and track down the extra but it highlights only the margin and padding I have specified and doesn't give any clues to the additional space. Have seen plenty of navbar tutorials but not with margin between list elements. Any help is much appreciated... hey all..got a wierd one..well to me anyway ! hope someone can tell me what im doing wrong !! i have code like this Code: #banner img { height: 15em; width: 25em; margin: 0.5em; } to manage the size of an image but i want to add another image to the page and i can't the css can be found here and the page im working on can be found here if anyone has any ideas that wouldbe marvelous... thanks RF Hello, Is there a way to have padding (say 15px) all around a cell, but allow for expections, like having one div element float:left and align far left against cell border while everything else is inset 15px. ie. Code: <style> #menubox { float:left; margin-left:15px; margin-bottom:7px; } .main_cell { padding:15px; } </style> <body> <table width=600 border=0 cellpadding=0 cellspacing=0> <tr> <td valign=top class="main_cell"><div id="menubox">table with menu items taht is achored far left against cell wall</div> Some text that wraps around "menubox" but needs to be padded around cell walls.</td> </tr> </table> </body> Thanks, Rey Hey everyone, I am making a design to kill some time, and I have come across a problem. I have a menu at the top which has no top padding unless I give it padding of 87px. I find this very odd, and it happens in every browser( Firefox 2.0.0.3, Opera 9, IE6-7 ); is it a bug in CSS itself or am I doing something wrong? Here is my code, maybe I am missing something. html4strict Code: Original - html4strict Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title></title> <style type="text/css"> body { background-color: #082567; color: #FFFFFF; margin: 0; padding: 0; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; font-size: 12px; text-align: justify; } #top-menu { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; height: 130px; } #top-menu h1 { float: left; font-weight: bold; letter-spacing: -3px; font-size: 31px; padding: 5px; } #menu { float: right; list-style-type: none; text-align: center; } #menu li { display: inline; } #menu a { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; color: #FFFFFF; padding: 50px; } #menu a:hover { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=0C39A1&EndColor=082567&Format=jpeg ); background-repeat: repeat-x; } </style> </head> <body> <div id="top-menu"> <h1>ryon.hunter</h1> <div id="menu"> <ul> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> </ul> </div> </div> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" I validated it and it validates fine, any suggestions? I have the navigation set so that the background turns green on the current page. When you hover over the other links they turn green. However, I do not want the active link to change colors when it is hovered over. How do I stop this from happening? http://brittanyrubinstein . com/fulcrum/index.html We recently decided to alphabetize the Specialties on our web pages (using the .php files from the Includes folder). I have re-alphabetized them in both the .php file as well as the default.css file including making the first image coincide with the alphabetized list. However, when I do, the original image (for Hospitality) remains as the default image and only changes when you finally hover over Hospitality or anything below it. Here's the way part of the original file is set up: /* Images */ div#specialties ul li a.hospitality span.img { position: absolute; top: 0; right: 0; width: 222px; height: 190px; background-image: url(../images/hospitality.jpg); background-repeat: no-repeat; z-index: 0; } div#specialties ul li a.hospitality:hover span.img { position: absolute; top: 0; right: 0; width: 222px; height: 190px; background-image: url(../images/hospitality.jpg); background-repeat: no-repeat; z-index: 0; } And here's what I changed it to: /* Images */ div#specialties ul li a.apartments span.img { position: absolute; top: 0; right: 0; width: 222px; height: 190px; background-image: url(../images/apartments.jpg); background-repeat: no-repeat; z-index: 0; } div#specialties ul li a.apts:hover span.img { position: absolute; top: 0; right: 0; width: 222px; height: 190px; background-image: url(../images/apartments.jpg); background-repeat: no-repeat; z-index: 0; } Help! You can check out the current look at Connell Insurance dot com. . A thousand apologies -- this is a very poorly worded and general question, because I've learned through scavenging and don't know the jargon, and the answer might not even lie in CSS... but the problem is really driving me to distraction. Is it possible in CSS to define a hover effect such that upon hovering over one element, a different element is affected? For example, I know you can add something like this: #example a:hover{ color: #000000; } in order to change the color of any links in the example div upon hovering. But can you change properties of links in any other divs? If so, then how? And if not, then is there a different language which can effect this change? Again, a thousand apologies for the amateurishness and outsider-wording of this question. I will be happy to clarify on request to the extent of my ability. I was asked by one of my friends if this was possible, and I didn't think it was but figured I'd ask here just in case... With image maps, you can have parts of an image link to different pages based on coordinates.... I wanted to know if there was a way to link to different pages based on colors on an image. Doesn't necessarily have to be done in CSS... just looking in general as to if this is possible, and what would be the best approach. Thanks. If anyone can help me with this, I will owe my life, because I'm in over my head with a project for my electronic media class and I'm not good enough with CSS. I need to make divs appear when I hover over images. The images aren't links, just anchors. I have a long page with a ton of images, and I need divs (with tables inside) to appear when I hover over those images. Also, if possible.. I'd like the appearing divs to move relative to the browser, but if not, I'll settle for absolute. It must be so simple, but I'm waaay too stressed to get this to work. :[ |