CSS - Div's Problem (very Important)
i want to transfer this table to div's but i tried many times and i can not make it...
so please i need help Code: <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="159" align="left" valign="top" style="background-color:#F00">first td</td> <td width="460" class="middle" valign="top" style="background-color:#FF0">second td</td> <td width="180" rowspan="2" valign="top" style=" background-color:#ff0000"><p>third td which contains rowspan =2 </p> <p> </p> <p>to let it finish with the footer</p></td> </tr> <tr> <td height="60" colspan="2" align="left" valign="top" style="background-color:#C60"><br /> new tr that contains colspan = 2 <br /> © 2002 - 2010 , All Rights Reserved. </td> </tr> </table> please help me i need to fix my problem quickly Similar TutorialsHi, I'm currently designing a Wordpress skin for someone and trying to style the navigation using CSS. Given that Wordpress is so popular, I expect that someone has encountered this before - but I can't find anything about this particular problem. Basically, I'm having problems achieving the correct precedence in the CSS cascade for certain elements of my page (navigation) design. In one part of the CSS I've had to use !important to get it to behave appropriately, but then I have another part which I need to be able to denote as "very important" but I don't think this is possible. I get the feeling that I can probably do this without !important since I'm aware that it is abusing its purpose a bit (i.e. accessibility?) and instead I could do it according to the selector's specificity if I understood it better: http://www.w3.org/TR/REC-CSS2/casca...cascading-order Here's a HTML snippet of what I have in the navigation: html4strict Code: Original - html4strict Code <div id="sidebar"> <ul> <li class="page_item current_page_item"> <a title="Home" href="home.php">Home</a> <ul> <li class="page_item"> <a title="Directors" href="home.php?page_id=12">Directors</a> </li> </ul> </li> <li class="page_item"><a title="News" href="home.php?page_id=3">News</a> </li> </ul> </div>
I'm then using the following CSS to attempt to style this part: css Code: Original - css Code #sidebar { float: left; width: 149px; padding: 1em 0; } #sidebar ul { list-style: none; } #sidebar ul li { margin: 0.4em 0.8em; padding: 1px; } #sidebar ul li a { font-size: 1.5em; font-weight: 500; padding: 0.3em; text-decoration: none; color: #000; background: #FFFACD; display: block; border: 1px solid blue; } #sidebar ul li a:hover { color: #bb2a2a; } #sidebar ul li ul li { display: none; } #sidebar ul li.current_page_item ul li, #sidebar ul li.current_page_parent ul li { /* sub-menu item */ display: inline; padding: 0; margin: 0; border: none; } #sidebar ul li.current_page_item, #sidebar ul li.current_page_parent { border: 1px solid green; } #sidebar ul li.current_page_item ul li a, #sidebar ul li.current_page_parent ul li a { /* sub-menu item link */ font-size: 1.2em; padding: 0.1em 0 0.2em 17px; background: #FFFACD url(images/sub-dot.gif) no-repeat left; } #sidebar ul li.current_page_item a, #sidebar ul li.current_page_parent ul li a.current_page_item { color: #bb2a2a !important; border: none !important; } .current_page_item ul li a { color: #000 !important; border: none !important; } #sidebar ul li.current_page_parent ul li a, .current_page_parent a { border: none !important; } #sidebar ul li.current_page_item ul li a:hover, #sidebar ul li.current_page_parent a:hover { color: #bb2a2a; border: none !important; }
Using "View Formatted Source" in FF I'm finding that the color defined in ".current_page_item ul li a" is over-ruled by "#sidebar ul li.current_page_item a, #sidebar ul li.current_page_parent ul li a.current_page_item". As you can perhaps tell, the current_page_item class is set on the list item that matches the current page, and if the current page is within a sub-section (i.e. it has a parent), current_page_parent will be set to the parent list item. This gives me a navigation such as: > Home >> Directors If we're on the Home page (as in example code above), I want that to have the red colored text, but Directors to be black. If Directors is the current page, I want that to be red, and Home to be black. Basically anything that isn't the current page should be black... At the moment (because .current_page_item ul li a doesn't seem to work) I'm getting red text for Home and Directors when on the Home page... I want Directors to be left black in this situation. N.B. It's more complicated than above because I also want to do some styling with borders on the top level list items (well, the a element within), but if someone can point out where I'm going wrong with the above I think I should be able to sort the rest out... Thanks in advance - please let me know if you need more details! I have 2 css files. One main one that I am using Code: input[type="text"], select { background: #FFF !important; } I use that mainly for Firefox as without it the form fields are yellow. but I would like to override that have have one form field on this one page stick out and have it like this. Code: .CCfield { color: Black; background: #FFFF66; } Is this doable? How can I override it for this one field? Thanks I was in a meeting today talking about relative font sizes and how they can be problematic, because nesting elements may increase or decrease their font size. A co-worker said that I could use !important in my CSS to override/ignore the font-sizes of any nested elements. He seems to be way off. The W3C says that !important is really just about user versus author stylesheets, and apparently declaring !important in an author stylesheet doesn't do anything. So first question -- am I right about !important? It's only about user and author stylesheets, yes? Second question -- When dealing with relative fonts and nested elements, you have to start writing pretty complex rules, right? Is there any easy way in CSS without writing multiple rules to say "regardless of what element I place you in, always be x% font size..."? Hey!! What's the difference between: font: small Arial, sans-serif!important; and font: small Arial, sans-serif; thanks Hey, I think i just need someone else to look at this for me. I've been coding all day and would probably be able to figure this out if I just went to bed and did it tomorrow. If you roll over an image that's alson an anchor at www.deeperdevotion.com/wp, you'll find that it places a background-color or underline or both on it. The thing is, I can't find the code in my CSS that's causing me the trouble. my css is located at www.deeperdevotion.com/wp/wp-content/themes/dd/styles/101106.css Thanks. Hello everyone, I am hoping I could get some help on this. I'm the new Marketing guy at this company. One of my duties is to fix an issue with our website which was built by the last guy to sit in this chair. I may not know how to build a proper webpage, but this guy knew exactly how not to do it and ran with just that. So, the issue lies within this example page: tinyurl.com/rediculouswebsite The footer ends up under-lapping the table when viewed in IE (when not in compatibility mode) and Firefox. I know this is a ridiculously constructed site, I just need to fix this one problem and be done with web development forever. High fives and scotch from my boss very well may ensue. Thank you all very much. Hello. I am new at css and web design so if these are easy problems please excuse. First of all, the website url http://www.onlinecasinoboss.com In Firefox, the unordered lists <ul> in the left column do not display correctly. The left margin is way too big. I'm not sure why, please look at the page in IE to see what I want it to look like. And in Internet Explorer, the spacing between my top image, header bar, and main page is screwy. There should be no space between the header image and header bar (the flags are in this area). Also there should only be 2px spacing between the header and the main page, however it appears there is atleast 24px there. Again please refer to the page in FF to see what I want it to look like. I like css, and have decided to pursue my first design in css based off of the many professional designers reconmendations and reviews. But I must say it is a major headache to deal with cross-browser/platform display problems. And what professional designer wants to rely on 'css-hacks' when producing a product for a major vender. Just beginner bitching. Thanks for the help! I'm trying to migrate my web site from layout with HTML tables to a CSS-only layout. After a great deal of blood and tears, I was able to get the page to display the way I wanted in Mozilla Firefox version #1.0. However, I'm having a problem in Internet Explorer 6. I'm using a 3-column layout. I want to split a portion of the center column into 2 divisions that lay out side by side. The left division will display an image. The right side some text. IE6 stacks the content vertically, instead of side by side. I've attached the CSS file and HTML file in a zip file. If you could take a look at my code, and suggest a hack for IE6, I'd appreciate it. The Sunburned Surveyor P.S. - Other comments on ways to improve the code or page layout are also welcome. Hi, I have a div with a form in it that's not displaying properly in IE. It's meant to display a breadcrumb menu and text input on opposite sides of the screen then followed by a hr, but in IE the input displays below the menu text and interferes with the hr... CSS: Code: #contentHeader { margin-top: 2px; font: 11px lucida grande, verdana, arial, sans-serif; padding-top: 2px; clear: all; } #pathway { float: left; } #searchForm { text-align:right; float:right; margin-right: 5px; } html: Code: <div id="contentHeader"> <span class="pathway">Home </span> <div id="searchForm"><form action='index.php' method='post'><input class="inputbox" type="text" name="searchword" size="15" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /><input type="hidden" name="option" value="search" /></form></div> </div> <hr /> you can see what happens here - http://jmaid.org/index.php?option=c...ntpage&Itemid=1 - How can I fix this? TIA I use a stylesheet to define the style of 'a' i.e hyperlinks. it looks something like this: a { color:white; font-family:verdana, arial, helvetica, sans-serif; text-decoration:none; } a:link {color:white;} a:visited {color:white;} a:hover {background-color:white; color:#808080; } This works great, but how do I explicitly change the style of other hyperlinks on the same page. They would typically be in a div. I have tried all kinds of things anc just can't get it to work. Thanks a lot... Hello, I am having a bit of problem with UL code in my sidebar for my website. In Safari the two items in my list display correctly under the paragraph of text, but in most other browsers the first part of the first item, jumps up and overlays itself in the upper paragraph. Here is my CSS code: Code: ul.sidebar { margin: 0 0 5px 0; padding: 5px 0 0 25px; } ul.sidebar li { font-size: 75%; list-style-type: circle; } ul.sidebar li a { color: black; list-style-type: circle; height: auto !important; } And here is its implementation on the website: Code: <div id="midcont"> <!-- left body div starts here--> <p>Please use the contact form to the right for inquiries. Most questions are answered within 24-48 business hours. Below is our direct contact information.</p> <br/> <ul class="sidebar"> <li><b>E-Mail:</b> xxx@xxx.com</li> <li><b>Phone: </b>(xxx) yyy- zzzz</li> </ul> <!-- left body div ends here--> </div> Thanks in advance for all your help! Link is he http://setupyourblog [dot] com Problem solved, thank you very much Go to my site. Click on Pokemon. What do I need to do to make it so the layout works on every page with every browser? Do I need to edit my .CSS file? Hey all, I'm having this problem with some code. as you can see, I have a wrapper div keeping everything centered. Then I have a headwrap div keeping the menu etc together and below that I want to have content. Here is the HTML <div id="wrapper"> <div id="headwrap"> <div id="title"></div> <div id="menuarea"> <div id="menupic"></div> <div id="nav"> <ul> <li id="one"><a href="#">Home</a></li> <li id="two"><a href="#">Buy</a></li> <li id="tre"><a href="#">Sell</a></li> <li id="for"><a href="#">About</a></li> <li id="fiv"><a href="#">Contact</a></li> </ul> </div> </div> </div> <div id="content"></div> </div> Here is the CSS #wrapper { width:780px; margin:0 auto; text-align:left; } #headwrap { width:780px; height:auto; margin:0px; padding:0px; } #title { float:left; width:262px; height:300px; border:1px solid #97A953; } #menuarea { float:right; width:510px; height:300px; border:1px solid #97A953; } #content { font-size:12px; } In IE the content div shows up below the headwrap div just fine. I can add a margin on top to drop the content down a bit without problems. BUT in FF the content div ends up enveloping the headwrap. When that happens I can't margin the top. It just ends up pushing down the headwrap div, too. Any thoughts as to why this is happening pls? I am sorry, I can't show the page as an example as it is a clients website. Basically the problem is the box model (I think). In IE the background file loads fine, but in FF it doesn't. It is a box inside a box, inside a box. I have tried body #divname html # divname html > divname and all other selector variants I can think of to no avail. I was wondering if this is a known problem. I thought it might be z-indexing but div's inside the affected div are picking up their background images. i'd like to align my table to the left, i ve tried so many stuff but cant get it.... in html something like this <table width="75%" border="0" align="left"> what is the css way of getting this result... pls help me out... Hi, I am a newbie to css and have attempted to convert various webpages to css over the past few months. Although I am new to css I have been working on computers (programmer and user) for the last 13 years. My main observation is that css is being limited by the inability or lack of interest on the part of browser developers to ensure that all pages are rendered the same in all browsers. It is very frustrating to work hard on a complicated layout only to open the page from another browser and have all your hard work look as if it has been through the spin cycle. Of course such criticisms apply in other circles, for example different compilers handling c/c++ code is slightly different ways. For a programmer working on code to run him/herself this is not so serious since you get the code to work on the machine you want it to run on, with webpages we don't have that luxury. Any thoughts? R Haynes Hey guys. I made a little news script for my site, but if I submit more than 1 news "article" IE doesn't style it. It will style the first article though. In FF everything is fine... If you view it in firefox you will see what im talking about. To see it visit http://www.leetwebmasters.com/beta_site/test2/ Where it says "THIS TEXT SHOULD BE GRAY", that part is the title and everything on that line should be gary, then below it is the news, "meh". Here is my code: 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>Untitled Document</title> <link rel="stylesheet" href="styles/style.css" /> </head> <body> <div id="container"> <div id="topbanner"><img src="images/topbanner.gif" /></div> <div id="mainbanner"><img src="images/mainbanner.gif" /></div> <div id="navbox"> <div id="navigation"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> <li><a href="#">Link 5</a></li> <li><a href="#">Link 6</a></li> </ul> </div> <!-- END NAVBOX --> </div> <div id="viewnews"> <?php include(''); $query = "SELECT * FROM articles LIMIT 4"; $rs = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_object($rs)) { print "<div class=\"title\">"; print "Title: ".$row->title ." | Submitted on: ". $row->date . " | Submitted by user: ". $row->submitted_by; print "</div>"; print "<div class=\"news\">"; print "News submitted:<br /> ".$row->news; print "</div"; } ?> </div> <!-- END CONTAINER --> </div> </body> </html> CSS: Code: #container { width:950px; margin:auto auto; } #mainbanner { clear: both; } #viewnews { float: right; width:750px; height:450px; } .title { float: right; background-color:#D6D6D6; width:750px; height:35px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; } .news { background-color:#F5F5F5; } #navigation { float: left; width: 200px; } #navigation ul { list-style: none; margin: 0; padding: 0; } #navigation li { border-bottom: 1px solid #828282; } #navigation li a:link, #navigation li a:visited { font-size: 90%; display: block; padding: 0.4em 0 0.4em 0.5em; border-left: 12px solid #828282; border-right: 1px solid #828282; background-color:#939393; color:#EDEDED; text-decoration: none; } #navigation li a:hover { background-color:#AAAAAA; } Can someone please help me? I can't figure out what is wrong I've got this little navigation menu, everything works in Opera and Firefox, but in IE the border overlaps the whole thing.. See at http://www.leetwebmasters.com/2.0 CSS: Code: #menu3 { width: 200px; border:1px solid #BCD2E6; border-style: solid solid none solid; } #menu3 li a { height: 24px; text-decoration: none; } #menu3 li a:link, #menu3 li a:visited { color: #8BADCF; display: block; background: url(menu3.gif); padding: 8px 0 0 10px; } #menu3 li a:hover { color: #627EB7; background: url(menu3.gif) 0 -32px; padding: 8px 0 0 10px; } #menu3 li { list-style:none; } #menu3 ul { padding-top:0px; margin-top:0px; padding-left:0px; margin-left:0px; } I've spent a good amount of time searching this site for an answer. Although I found some good information, I am still hitting this brick wall. My DIV tag works in IE but not FF. Below are three links. The top two are to my site and the one below is to another site doing the same thing I'm doing but working fine in both browsers. I can't explain it any better. http:www.humito.com/contact.html (set up for IE) http:www.humito.com/contact2.html (set up for FF) http://plazamexico.com/menu/abouttheplaza.html (just like first link) can someone share some insight. |