CSS - Ie7 Adds Border Width To Overall Size Of A Div?
dear all,
some simple divs of mine seem to be rendering differently in IE6 and IE7. for example, the following style works fine in IE6... Code: #calHourNow { background-color: #FFFF66; margin:0px; padding:0px; width:50px; height: 120px; border-top:1px solid #999999; border-right:1px solid #999999; color:#000000; font-weight:bold; font-size:14px; text-align:right; font-family:"Times New Roman", Times, serif; } ... I am left with a 12o x 50 px box (which is repeasted down the page) but in IE7 it seems the 1px border is added to the width and height, leaving me with a div that is actually 121 x 51 px. It is completely vital for my project (an outlook style calendar) that the dimensions of these divs are exactly the same on both browsers, is there a way round this? Many thanks, Mark Similar TutorialsHi there Has anyone encountered a bug in IE (6) of extra width, when applying css height property to a div? I set the width of div, via margin Code: div#footer { margin: 0px 9%; height: 40px; } When height is specified, the width of the footer is 1px bigger on either side, then other elements with same margin, but no height. This does not happen in other (gecko) browsers! Anyone know a solution, (tantek won't be precise enough with %) ?? i'm trying to style my submit button to have a gradient background with a solid blue border. looks awesome in FF, however when I try to apply the background image to the submit button in IE (6 and 7), there will be an extra border inside of the blue border. it seems to be whatever color i set my background-color to. Code: border: 1px solid #69A2CC; background: transparent url(gradient.jpg) no-repeat scroll 0 center; I'm trying to make 2 boxes next to each other at the right of the screen. I have them aligned OK but I'm having trouble with the width of the borders. With the CSS as is I get a thick border in IE6 and a thin border with Firefox. When I use the bold part instead I get a thin border in IE6 and NO border in Firefox My aim is to have a thin border. What is the correct way to do it? Is there a way that will render the same in IE6 and Firefox? Code: div.container { overflow: hidden; width: 100%; } div.side { float:right; width:150px; /*border-style: solid; border:1px;*/ border: thin solid; margin:5px; } html Code: Original - html Code <DIV CLASS="container"> <DIV CLASS="side"> E05050439 </DIV> <DIV CLASS="side"> <H2>Reference Number</H2> <P>Please quote this number on all correspondence</P> </DIV> </DIV> <DIV CLASS="container"> <DIV CLASS="side"> E05050439 </DIV> <DIV CLASS="side"> <H2>Reference Number</H2> <P>Please quote this number on all correspondence</P> </DIV> </DIV> I need advice on the below code: xhtml: <input name="a_name" id= "a_name" type="text" value="a value" size="50" maxlength="100" /> css: input { width: 300px; } Given this set up what is the relevance of the size attribute of the input tag considering the css width setting? Aside from what happens if a user disables the stylesheet, is it even necessary to include the size attribute? Any browser issues with this code? Hi, I am trying to add a 8px border under my headings, but I only want it to go as far as the word. At the moment, it is going the whole width of my div container. This is what I have at the moment: PHP Code: #sidebar h2, #sidebar h3 { color: #444; font-size: 20px; font-weight: normal; margin: 0px 0 5px 0; padding: 0px 0 0px 0; border-bottom: 8px solid #FE9023; } Any help would be great. Thanks Hi there, Is it possible to set a border's width? when I say width I mean it's horizontal width not height. Many thanks New guy on the scene - I need a little help. Seems basic, but I can't figure it out. html and body tags set to a width of 100%. I have a div that I want to be 100% with a border. If I set it to a width of 100% and a border of "1px solid #000" the div actually expands 2 pixels beyond the right edge of the page in FF. Haven't tried it in IE yet. In any case, anyone know how to solve this? If not, any creative work-arounds? Thanks. Hello all I need to display the Login info inside a DIV 'WELCOME <USER FIRST NAME AND LAST NAME>' i have set the width of the DIV and a font size - 16px but when the name length increases the design brakes One way of solving the issue is by applying some logic using scripts but i want to know that whether we can do anything using the same with CSS only Regards Anees please see following code. (i want myHeight becomes dynamis, that mean when user resize the browser, it will be changed automatic w/o refresh the page). thank you. waitting online for the answer. <html> <head> </head> <body > <table> <tr><td>tasd</td></tr> <tr><td> <script type="text/javascript"> var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } //var height = myHeight *.8; document.writeln("<div style='HEIGHT:" + myHeight *.8 + "; WIDTH:100%; OVERFLOW:auto'>"); //return height; </script> <table> <tr><td> msg </td></tr> </table> </div> <td> msg </td> </table> </body> </html> Something for the css pros: Can anybody give me a hint on how to convert the following (table) based markup snippet to div-only markup? http://www.twosailors.net/test.html In all my tests I cannot get the rightmost cell expand so the whole menu gets it's total size. I do NOT want to convert the boxes to fixed width but keep them shrinkwrapping around the menu texts. Also, I do want a border around the boxes so any faking with background colors will not work either. Any ideas? Andreas Pardeike Alright, this is probably a simple fix but I can not find the solution anywhere. I'm trying to highlight a table cell with a 2px solid red border when it is clicked. Is there a way to get this to happen with out changing the size of the cell? I hope this makes sense. Basically the cell is expanding by 1 px causing movement in the table. Hi I am a blogger user and write an English blog. I want to add a section in my blog's sidebar for adsense. It is a three column template, what I want it to add a single column at the top of 2 columns of sidebar. http://linguisticslearner.blogspot.com/ And below is the template code. Code: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> <head> <meta content='JAoqkG38S809dZLsa5uoS08FSskzqxBwsprrllDajqY' name='google-site-verification'/> <b:include data='blog' name='all-head-content'/> <title><data:blog.pageTitle/></title> <b:skin><![CDATA[/* ----------------------------------------------- Blogger Template Style Name: Grid Focus Designer: Derek Punsalan URL: www.5thirtyone.com Updated by: Amanda Fazani (www.BloggerBuster.com) Date: 14 August 2008 ----------------------------------------------- */ /* Variable definitions ==================== <Variable name="bgcolor" description="Page Background Color" type="color" default="#fff" value="#ffffff"> <Variable name="textcolor" description="Text Color" type="color" default="#333" value="#333333"> <Variable name="linkcolor" description="Link Color" type="color" default="#333" value="#333333"> <Variable name="pagetitlecolor" description="Blog Title Color" type="color" default="#555" value="#555555"> <Variable name="descriptioncolor" description="Blog Description Color" type="color" default="#555" value="#555555"> <Variable name="titlecolor" description="Post Title Color" type="color" default="#333" value="#333333"> <Variable name="sidebarcolor" description="Sidebar Title Color" type="color" default="#333" value="#333333"> <Variable name="sidebartextcolor" description="Sidebar Text Color" type="color" default="#666" value="#666666"> <Variable name="bordercolor" description="Border Color" type="color" default="#eee" value="#eeeeee"> <Variable name="metacolor" description="Meta DataColor" type="color" default="#7f7f7f" value="#7f7f7f"> <Variable name="bodyfont" description="Text Font" type="font" default="normal normal 100% Arial, sans-serif" value="normal normal 100% Arial, sans-serif"> <Variable name="postfooterfont" description="Post Footer Font" type="font" default="normal normal 95% Arial, sans-serif" value="normal normal 95% Arial, sans-serif"> <Variable name="startSide" description="Side where text starts in blog language" type="automatic" default="left" value="left"> <Variable name="endSide" description="Side where text ends in blog language" type="automatic" default="right" value="right"> */ /* Use this with templates/template-twocol.html */ html, body { background:$bgcolor; color:$textcolor; text-align:center; margin: 0; padding: 0; font:12px arial,helvetica,verdana,sans-serif; } body #navbar-iframe { display: none; visibility: hidden; height: 0px; } /* Headings ----------------------------------------------- */ h1{font-size:22px; color: $pagetitlecolor;} h1 a{color: $pagetitlecolor;} h2{font-size:18px;} h3{font-size:16px;} h4{font-size:14px;} a{color:$linkcolor;text-decoration:none;} a:hover{color:#666;} a img { border-width:0; } /* Header ----------------------------------------------- */ /* masthead / footer - navigation and categories */ #masthead{padding:5px 0;} #masthead h1 a{text-transform:uppercase;width:400px;float:left;margin:12px 0 0 0;color:$pagetitlecolor;} #masthead h1 a em{font-style:normal;color:$pagetitlecolor;} #authorBlurb {width: 400px; float: right; color: $descriptioncolor;} #authorBlurb img{float:right;width:42px;height:42px;border:3px solid $bordercolor;} #authorIntro a{font-weight:bold;} #authorIntro{line-height:1.4em;width:400px;float:right;margin:8px 0 0 0;} #header-wrapper { margin:0 auto 10px; } #header-inner { background-position: center; margin-left: auto; margin-right: auto; } #header { color:$pagetitlecolor; } #header a { color:$pagetitlecolor; text-decoration:none; } #header a:hover { color:$pagetitlecolor; } #header img { margin-$startSide: auto; margin-$endSide: auto; } ul.nav{list-style:none;background:$bordercolor;padding: 0; margin-left: 0;} .nav li{border-right:1px solid #DDD;float:left;display:block;width:100px;} .nav li a{font-size:11px;outline:none;color:$titlecolor;text-decoration:none;display:block;padding:5px 0 12px 5px;width:99px;text-transform:uppercase;} .nav li a span{font-size:11px;color:$metacolor;text-transform:lowercase;} .nav li a:hover{background:$titlecolor;color:$bordercolor!important;width:95px;} * html .nav li a:hover{background:$titlecolor;width:99px;} .nav li.skip{border-left:1px solid #DDD;float:right;display:block width:100px;} .nav li.skip a{width:100px;} li.top{border-left:1px solid #DDD;float:right;display:block width:100px;} li.top a{width:100px;} .nav li.skip a:hover, li.top a:hover { background: transparent;color: $titlecolor !important;} .fix:after{content:".";display:block;height:0;clear:both;visibility:hidden;} .fix{display:inline-block;} * html .fix{height:1%;} .fix{display:block;} /* Outer-Wrapper ----------------------------------------------- */ #outer-wrapper { border-top:3px solid $bordercolor; margin:20px auto; width:965px; text-align:$startSide; font: $bodyfont; } #main-wrapper { margin:26px 0 0 0; width:410px; float: $startSide; word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } #sidebar-wrapper { color:$sidebartextcolor; float:left; margin:25px 0 0 33px; width:250px; line-height:1.3em; word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } .sidebar h2 {color: $sidebarcolor;} .sidebar ul{list-style:none;margin:8px 0 4px; padding-left: 0px;} .sidebar ul li{ background:url('http://4.bp.blogspot.com/_0CLPmP1ydOo/Sa7zbixhCTI/AAAAAAAABNQ/GPsIktrM5tw/s1600/li.gif') no-repeat 0 3px; color:$sidebartextcolor; line-height:1.2em; border-top:1px solid #BBB; padding-left:16px; padding-right:0; padding-top:4px; padding-bottom:4px; } #searchWrap input{vertical-align:middle;} #searchWrap #s{font-size:1.1em;border:1px solid #BBB;padding:1px 2px;margin-right:3px;width:220px;} #tertCol {color:$sidebartextcolor;} #tertCol{float:left;width:214px;margin:10px 0 0 33px;} #tertCol p{color:$sidebartextcolor;} /* Posts ----------------------------------------------- */ h2.date-header { margin:1.5em 0 .5em; } .postMeta{background:url('http://bloggerbuster.com/templates/grid-focus/images/dot.gif') repeat-x left center;text-transform:uppercase;font-size:11px;text-align:right;margin-bottom:5px} .postMeta span.date{background:$bgcolor;color:$metacolor;padding:0 2px 0 4px;} .postMeta span.comments{background:$bgcolor url('http://1.bp.blogspot.com/_0CLPmP1ydOo/Sa7yyg4qFKI/AAAAAAAABNI/2P6HSCDx4-g/s1600/chat_grey.gif') no-repeat left center;padding-left:15px;margin-left:2px} .postMeta span.comments a, .postMeta span.date a{color:$metacolor;} .post{margin:0 0 15px 0;} .post h2{line-height:1.2em;margin-bottom:7px;font-size: 18px;color:$titlecolor;} .post h2 a{width:100%;display:block;outline:none;color: $titlecolor;} .post-body { margin:0 0 .75em; line-height:1.6em; } .post-body blockquote { border: 3px solid $bordercolor; padding: 5px; line-height:1.3em; } .post-footer { margin: .75em 0; color:$sidebarcolor; font: $postfooterfont; } .comment-link { margin-$startSide:.6em; } .post img { padding:4px; border:1px solid $bordercolor; } .post blockquote { margin:1em 20px; } .post blockquote p { margin:.75em 0; } /* Comments ----------------------------------------------- */ #comments h4 { margin:1em 0; font-weight: bold; line-height: 1.4em; text-transform:uppercase; letter-spacing:.2em; color: $sidebarcolor; } #comments-block { margin:1em 0 1.5em; line-height:1.6em; } #comments-block .comment-author { margin:.5em 0; } #comments-block .comment-body { margin:.25em 0 0; } #comments-block .comment-footer { margin:-.25em 0 2em; line-height: 1.4em; text-transform:uppercase; letter-spacing:.1em; } #comments-block .comment-body p { margin:0 0 .75em; } .comment-general {background:$bgcolor ') top left; border:1px solid #BBB; margin-bottom:7px; padding:0 7px 7px; } .comment-blog-author {background:$bgcolor url('http://3.bp.blogspot.com/_0CLPmP1ydOo/Sa7zz4pTw_I/AAAAAAAABNY/7lF8YVNW-Go/s1600/lgrey_diag.gif') top left; border:1px solid #BBB; margin-bottom:7px; padding:0 7px 7px; } .deleted-comment { font-style:italic; color:gray; } #blog-pager { clear: both; margin: 10px 0;} #blog-pager-newer-link { float: left; } #blog-pager-older-link { float: right; } #blog-pager { text-align: center; } .feed-links { clear: both; line-height: 2.5em; } /* Sidebar Content ----------------------------------------------- */ .sidebar { color: $sidebartextcolor; line-height: 1.3em; } .sidebar .widget, .main .widget { margin:0 0 1.5em; padding:0 0 1.5em; } .main .Blog { border-bottom-width: 0; } /* Profile ----------------------------------------------- */ .profile-img { float: $startSide; margin-top: 0; margin-$endSide: 5px; margin-bottom: 5px; margin-$startSide: 0; padding: 4px; border: 1px solid $bordercolor; } .profile-data { margin:0; text-transform:uppercase; letter-spacing:.1em; font: $postfooterfont; color: $sidebarcolor; font-weight: bold; line-height: 1.6em; } .profile-datablock { margin:.5em 0 .5em; } .profile-textblock { margin: 0.5em 0; line-height: 1.6em; } .profile-link { font: $postfooterfont; text-transform: uppercase; letter-spacing: .1em; } /* Footer ----------------------------------------------- */ #footer-wrapper { margin: 10px 0; } #footer { width:660px; clear:both; margin:0 auto; padding-top:15px; line-height: 1.6em; text-transform:uppercase; letter-spacing:.1em; text-align: center; } .left {float: left;} .right {float: right;} .ctime {float: right;} #navbar-iframe { height:0px; visibility:hidden; display:none } /* Label Cloud Styles ----------------------------------------------- */ #labelCloud {text-align:center;font-family:arial,sans-serif;} #labelCloud .label-cloud li{display:inline;background-image:none !important;padding:0 5px;margin:0;vertical-align:baseline !important;border:0 !important;} #labelCloud ul{list-style-type:none;margin:0 auto;padding:0;} #labelCloud a img{border:0;display:inline;margin:0 0 0 3px;padding:0} #labelCloud a{text-decoration:none} #labelCloud a:hover{text-decoration:underline} #labelCloud li a{} #labelCloud .label-cloud {} #labelCloud .label-count {padding-left:0.2em;font-size:9px;color:#000} #labelCloud .label-cloud li:before{content:"" !important} ]]></b:skin> <script type='text/javascript'> // Label Cloud User Variables var cloudMin = 1; var maxFontSize = 20; var maxColor = [0,0,255]; var minFontSize = 10; var minColor = [0,0,0]; var lcShowCount = false; </script> </head> <body> <div id='outer-wrapper'><div id='wrap2'> <!-- skip links for text browsers --> <span id='skiplinks' style='display:none;'> <a href='#main'>skip to main </a> | <a href='#sidebar'>skip to sidebar</a> </span> <div class='masthead fix'> <b:section class='masthead' id='masthead' maxwidgets='1' showaddelement='no'> <b:widget id='Header1' locked='true' title='My Thoughts in Remote Language (Header)' type='Header'/> </b:section> </div> <div class='nav'> <ul class='nav fix'> <li><a expr:href='data:blog.homepageUrl' title='Return to the the frontpage'>Home<br/><span>Frontpage</span></a></li> <li><a href='http://awaz-e-dost.blogspot.com/' title='آوازِ دوست'>Link<br/><span>My Urdu Blog</span></a></li> <li><a expr:href='data:blog.homepageUrl + "feeds/posts/default"' title='Subscribe to the main feed via RSS'>RSS<br/><span>Syndicate</span></a></li> <li class='skip'><a href='#main' title='Skip to content'>Main<br/><span>Skip to content</span></a></li> </ul> </div> <div id='content-wrapper'> <div id='crosscol-wrapper' style='text-align:center'> <b:section class='crosscol' id='crosscol' showaddelement='no'/> </div> <div id='main-wrapper'> <b:section class='main' id='main' showaddelement='no'> <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/> </b:section> </div> <div id='sidebar-wrapper'> <div id='searchWrap'> <form action='/search' id='searchForm' method='get'> <input id='s' name='q' type='text' value=''/><input alt='Submit' id='searchsubmit' src='http://bloggerbuster.com/wordpress/wp-content/themes/grid_focus_public2/images/btn_search.gif' type='image'/> </form> </div> <b:section class='sidebar' id='sidebar' preferred='yes'> <b:widget id='HTML2' locked='false' title='' type='HTML'/> <b:widget id='Gadget1' locked='false' title='Share It' type='Gadget'/> <b:widget id='Label1' locked='false' title='Label Cloud' type='Label'/> <b:widget id='BlogArchive2' locked='false' title='Archive' type='BlogArchive'/> <b:widget id='HTML1' locked='false' title='Follow Me' type='HTML'/> <b:widget id='HTML4' locked='false' title='' type='HTML'/> </b:section> </div> <div id='tertCol'> <b:section class='sidebar' id='sidebar2' preferred='yes'> <b:widget id='Gadget2' locked='false' title='' type='Gadget'/> <b:widget id='HTML3' locked='false' title='' type='HTML'/> <b:widget id='Feed1' locked='false' title='Recent Posts' type='Feed'/> <b:widget id='Profile2' locked='false' title='About Me' type='Profile'/> <b:widget id='LinkList1' locked='false' title='Favorite Links' type='LinkList'/> <b:widget id='AdSense1' locked='false' title='' type='AdSense'/> </b:section> </div> <!-- spacer for skins that want sidebar and main to be the same height--> <div class='clear'>*</div> </div> <!-- end content-wrapper --> <div id='footer-wrapper' style='margin-top: 10px;'> <div class='nav' style='clear: both;'> <ul class='nav fix'> <li><a expr:href='data:blog.homepageUrl' title='Return to the the frontpage'>Home<br/><span>Frontpage</span></a></li> <li><a href='#' title='Link title'>Link<br/><span>Short Desc</span></a></li> <li><a href='#' title='Link title'>Link<br/><span>Short Desc</span></a></li> <li><a href='#' title='Link title'>Link<br/><span>Short Desc</span></a></li> <li><a expr:href='data:blog.homepageUrl + "feeds/posts/default"' title='Subscribe to the main feed via RSS'>RSS<br/><span>Syndicate</span></a></li> <li class='top'><a href='#outer-wrapper' title='Return to the top'>Top<br/><span>Return to top</span></a></li> </ul> <p><a expr:href='data:blog.homepageUrl'><data:blog.title/></a>. <a href='http://5thirtyone.com/grid-focus' title='Grid Focus by: Derek Punsalan'>Grid Focus</a> by Derek Punsalan <a href='http://5thirtyone.com'>5thirtyone.com</a>. Converted by <a href='http://www.bloggerbuster.com/'>Blogger Buster</a></p> </div> <b:section class='footer' id='footer'/> </div> </div></div> <!-- end outer-wrapper --> <script type='text/javascript'> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type='text/javascript'> try { var pageTracker = _gat._getTracker("UA-15934010-2"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html> I know very little about CSS, my wild guess is that I should change 'wrapper' classes in CSS but how? I do not know this. Can you please help me in this regard? Many Thanks Hi there. A very frustrating problem and so simple a situation . I have two divs, one stacked on top of the other. Nothing special with positioning or anything. Total barebones stuff. If I put an image (whether with image tag or as background-image) in the top div, the div will be padded on the bottom. This only happens in IE. As an example I have my page he URL The top div bgcolor is lime green, and you'll see it adds some extra space under the image. Compare in IE & FireFox and you'll see what I mean - green can be seen under the image in IE. The bottom of the image in the top div should be butted up against the top of the second div, whose bgcolor is red. No green should exist between the image and red. Thanks for any help, this should be rediculously simple for someone who knows CSS quirks well. page passed validation - xhtml 1.0 @ w3c.org I'm trying to create an image-navigation system using the popular css sprites technique. However, on the very first image (doesn't occur with any images following), IE6 (and below) increases the height of that image. Here's a very simple code. There are no other codes or elements to interfere with this issue, and yet, it is still present. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Title Goes Here</title> <style type="text/css"> .nav_top{background:url('http://i185.photobucket.com/albums/x14/mMaNgOeZz/nav-1.gif'); float:left; } #img1{background-position: 0px 0px; width: 1200px; height: 14px; } #img2{background-position: 0 -14px; width: 101px; height: 34px;} </style> </head> <body> <a class="nav_top" id="img1"></a> <a class="nav_top" id="img2"></a> </body> </html> Any help would be appreciated to no end. Thanks in advance. I am trying to style a form using CSS instead of tables but am getting unwanted space above form elements when i use float:right to position them to the right of the prompt text. I have spent some time reading about the problem which appears to be an error with IEs rendering of CSS. I have tried several solutions posted on the web with no success. Can anyone recommend a solution to my problem. Thanks. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css" media="screen"> .form { font-size:10px; text-align:left; } .form input { width: 100px; font-size: 9pt; border: 1px solid #891C46; margin-left: 12px; padding-top:0px; float:right; } .form select { width: 100px; float:right; font-size: 9pt; border: 1px solid #891C46; } .form textarea { width: 100px; float:right; font-size: 9pt; border: 1px solid #891C46; } .form li{ list-style-type: none; clear:both; } .form img{ padding-top:10px; float:right; } </style> </head> <body> <table cellpadding="0" cellspacing="0" width="500"> <tr> <td width="50%" valign="top" class="form"> <ul> <li>Your name:<input name="textfield" type="text"></li> <li>Your email address:<input name="textfield" type="text"></li> <li>Your company:<input name="textfield" type="text"></li> <li>Your position:<input name="textfield" type="text"></li> <li>Subject:<select name="select"><option>Digital Advertising</option></select></li> <li>Query/comment:</li> <li><textarea name="textarea" cols="20" rows="8"></textarea></li> <li><img src="/carlton-newsite/img/contactus/send.gif" name="send" width="50" height="25" id="send"></li> </ul> </td> <td valign="top">sfasfasfasdfasdfasdfasdf</td> </tr> </table> </body> </html> Hi there, I'm completely new to CSS. I'm trying to do this more than one hour but can't get it right. Code: <font color='white'><font size='1' face=verdana size=1> I couldn't find the equivalent of this in CSS This is my last experiment but it doesn't seem to work either Code: fontstyle { color : #FFFFFF; font-family : verdana ; font-size :1;} Thanks Hi. Have created some simple tabs using table cells. Active tab should have bottom-border color equal to page background-color. Non-active tabs should have bottom-border=black. Works fine in IE, but does not work very well in Firefox. If I remove the border-collapse:collapse on the table, then firefox also work... but I would like to be able to keep the 1px border between each table cell. So is there a way to make this work in both IE and Firefox... and hopefully most other browsers... See code below: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <style type="text/css"> a.menu_top:link {color: #000000; text-decoration: none;} a.menu_top:visited {color: #000000; text-decoration: none;} a.menu_top:hover {color: #000000; text-decoration: none;} a.menu_top:active {color: #000000; text-decoration: none;} td.menu_top_passive { background-color: #777; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #000000 solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } td.menu_top_active { background-color: #bbb; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #bbb solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } </style> <script language="JavaScript"> function change(id, url) { for (i=1; i<6; i++){ eval("document.getElementById("+i+").className='menu_top_passive'"); } eval("document.getElementById("+id+").className='menu_top_active'"); } </script> </head> <body style="margin:0; padding:0; background-color:#bbb;"> <br><br> <center> 1. Load the page.<br> 2. Click Item 4.<br> 3. Click Item 2.<br><br> Why is the bottom border of the menuelements (table cells) not getting correct in Firefox?<br> None-active menuelements should have a border-bottom = black, active should have same bottom-border as page.<br> Notice that I use border-collapse on the table in order to get the cell-border 1px thick between the menuitems.<br> If I remove border-collapse, then there is no strange behaviour in Firefox.<br> Any way to get this working in Firefox without breaking it in IE? </center> <br><br><br> <table border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse;"> <tr> <td id="1" nowrap class="menu_top_active" onClick="change('1');"><a href="javascript:;" class="menu_top">Item 1</a></td> <td id="2" nowrap class="menu_top_passive" onClick="change('2');"><a href="javascript:;" class="menu_top">Item 2</a></td> <td id="3" nowrap class="menu_top_passive" onClick="change('3');"><a href="javascript:;" class="menu_top">Item 3</a></td> <td id="4" nowrap class="menu_top_passive" onClick="change('4');"><a href="javascript:;" class="menu_top">Item 4</a></td> <td id="5" nowrap class="menu_top_passive" onClick="change('5');"><a href="javascript:;" class="menu_top">Item 5</a></td> </tr> </table> </body> </html> So when using Netscape 7.2 & Opera 7.5 and MSIE 6.0, How do you get a simple tag like body { font-size:small; } to be equal in all browsers? Setting IE Text Size to Medium, and Opera's Zoom to 100% (both defaults) and Netscape 7.2 to 120% (not the default) is one way, but is there a CSS way? By the way, the child element hack "body>div {property}" wasn't working no matter what I tried, by not working I mean to say Netscape never would read it or apply it. It appeared to be that Opera & IE need to read the same value while Netscape needs to apply a larger size to be equal to IE's and Opera's rendering. B I could see this as potentially being really easy to do or really hard to do. I'm hoping for the former. Suppose I have 3 divs, A, B, C and that I want the total width of A + B + C to equal the width of the screen. Suppose also that I want them to be inline. How can I have B to be a fixed width while A and C expand depending on the screen width (such that the width of A = the width of C)? Hi, I have hit the "wall" in my knowledge of CSS while trying to implement a "flex-width-equal-height-sidebar-layout" style of layout as a skin/theme for a message board system and need some help. My trouble occurs when a direct link to the post is used (instead of following the menu navigation system) where the top menu information/links area (the area between the banner and the post) is chopped off... The relevant portion of the CSS seems to be the .col_wrap {margin-top: 10px; border: 0; overflow: hidden; float: left; width: 100%; position: relative; z-index: 10; clear: both;} portion of my CSS because if I take out the overflow:hidden declaration then the menu portion of the skin/theme/layout shows correctly but the sidebar the shows the part which should be hidden at the bottom and the footer completely vanishes from view! My apologies but this is the best I can do without having the ability to post pics or urls which could better explain what is wrong and frankly speaking I don't know how anyone here can help given my inability to show the problem but hopefully someone knows or has run into this problem before or can offer some resources that may be of assistance.... |