CSS - Valign Using Styles
Ok so what is the css substitute for the valign tag?
Thanks! Similar TutorialsBasically, I'm trying to get a div *bottom* to stick to the bottom of the page always, regardless if div *content* has enough data to push it down. Simple right? But it also needs to be able to align below the page just below *content* if the page needs to scroll, so it can't be aligned "absolutely". So how's it done? Code: <!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" title=""> #sidebar { background-color: #00CC00; float: left; height: 100%; width: 250px; } #content { background-color: #FF66FF; float: left; height: 100%; width: 600px; } #bottom { background-color: #CCCCCC; clear: both; width: 500px; bottom: 0px; } </style> </head> <body> <div id="sidebar">Sidebar</div> <div id="content"> <p>Main Content Area </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <div id="bottom">Bottom Nav Div - this page is layingout correctly. </div> </body> </html> so i got theese spans you see he < | Detail Panel | Detail Panel | > theese spans are in the div with a border now i want to position theese spans vertically centered on the top border like image below can someone show me how to acheive this. i have a cheap method but it gets messed up if the user changes font size. i used position and top but if the user changes the text size via the browser it throws it off. i was hoping for a way that keeps them vertically centered no matter what the font size, at least on page load. img.photobucket.com/albums/v135/noitidart/cssfloat.gif thanks very much its urgent i want to have organized game boxes. the way i want it organized is for the image to be on the left, and the text to the right of the image. however, i want the image to be in the vertical middle of the div and the text to also be in the vertical middle. the problem with what i have now is that the image is always at the top of the game box div and so is the text. ALSO, i want the WHOLE GAMEBOX to act as an <a>, and not just the image and the game title. is that possible? Code: if ($a == 2) { echo " <div class='gamebox clearboth floatleft halfwidth'>"; $a = 0; } else { echo " <div class='gamebox floatleft halfwidth'>"; } $a++; $game['desc'] = str_replace("'", "'", $game['desc']); $game['desc'] = "<span class='gdesc'>".$game['desc']."</span>"; $link = get_game_link("id="._sp($game['id'])); echo "<a href='".$link."' class='gamelink'>"; // display game echo " <div class='floatleft'> <img src='[imgdir]".$game['nameid'].".png' alt='Play ".$game['name']. "' title='Play ".$game['name']."' class='gamethumb' /> </div> <div class='floatleft wordwrap' style='width:75%'> <h3 class='nomargins'><a href='".$link."' class='gamelink'>".$game['name']."</a></h3>"; $rating = round($game['rating']/2); echo " <img class='nomargins' style='border: 0px' src='[themedir]/ratings/".$rating."stars.gif' alt='".$game['name']." Rating' />"; echo " <p class='nomargins'>".html_entity_decode($game['desc'], ENT_QUOTES); if (theme_is_admin()) { echo "<small>"; echo theme_admin_link("Manage Games", "darklink", "games", "manage"); echo " - "; echo theme_admin_link("Edit This Game", "darklink", "games", "editgame-form", "id=".$game['id']); echo "</small>"; } echo " </p> </div> </a> </div>"; Hi everyone, I have a problem I'm trying to overcome with displaying an image next to the text in a table cell. I've set the table cell to valign=middle and this achieves the layout I want (hopefully this demonstration will look right..) Code: PICTUREHERE PICTUREHERE PICTUREHERE The text goes here PICTUREHERE PICTUREHERE So the text and the picture are laid out along the middle of the cell. However as soon as the text gets too big for the cell (or the cell gets smaller) this happens: Code: PICTUREHERE PICTUREHERE PICTUREHERE The text goes here, but when it's longer PICTUREHERE PICTUREHERE the remainder comes here I knew this to be because the img is still an inline element in the cell. I tried to solve the problem by making the img float:left, but the following happens, even if the valign=middle property is set in the cell: Code: PICTUREHERE The text goes here, but when it's longer PICTUREHERE the remainder comes here PICTUREHERE PICTUREHERE PICTUREHERE Is it possible to achieve the top layout. If it is can someone help me please (it's probably staring me in the face) Thank you in advance Andy Hi, I'm sure this has been covered before, but I can't seem to find an example that relates to what I'm doing. I basically want an to have a image with text on the left of it that is vertically alignment to bottom of the image. Here's a link to a table version. "visualstrategies.ca/jf_mackie/test.html" I've been playing with a css only version for 5 hours and can't figure it out. Any help would be great thanks. sskully I'd like to seperate blocks of text with a horazontal rule. I'd like it to be dashed. So, I've come up with this: Quote: hr { border: none 0; border-top: 1px dashed #000; width:98%; height: 1px } However, although this works well in IE, it Firefox there is too much space between the HR and the text block under it. In other words, the text above the HR comes right up to the line, but the text under the line, there is a larger gap. Any way to close the gap? Any ideas? Hello -- new to this forum. My questions concerns a problem I've run into many times. I'm trying to be CSS-moral and use style sheets as much as possible, or a least place properties in the Header. But here's what I run into. Many times I find it necessary to have different properties for the same tag within the Body. Currently, I use CSS to create the Menu items at the top of each web page, an Unordered List, using the "li" tags. Ok, but I just discovered that by using a new CSS statement, I can use custom bullets in the Body's li tag: list-style-image : url(bullet.gif) . Cool!!! So, I went about making a little dog bone .gif and used it for my bullet graphic halfway down the page. Voila! It worked. Voila! I suddenly have dog bones in my menu (which I don't want !), which also use the li tag. I only know two workarounds. 1) is to go back to the BAD practice of using the taboo in-line style="images/dogbone.gif" in each li within the body and NOT put the statement in the Header style section or 2) at least try to use CSS in the header by making a class like li.bone { list-style-image : bone} and then repeat class="bone" for each li in the body, which is only slightly shorter than just putting in the style="xxx" in the first place. So, how do we handle using different style properties for the same tag within the body? Perplexed, Mike Unfortunately I am not very experienced and I am trying to edit some coding that has been done for me. The code is as follows <div title="[[TITLE]]" style='background-image: url ([bg]); padding: 5%; width:90%; height:100%; padding-left: 6%; padding-right: 6%; background-size: 100% 100%; '> Now what happens is the words I type in this box are beautifully laid out because of the padding... The images placed in the box should stretch border to border - but obviously don't because of the padding.... Can anyone please tell me what I can change to give my text padding but images with no padding? Thanks so much Hi, I remember reading that there is a css attribute for removing all browser-specific formatting from an element, for example forms, H tags and divs (which are pre-formatted differently in ie and firefox) but I can't recall what it was! Does anyone know how this is achieved as I find it very laborious when creating stylesheets to have to remember to reset all of these elements' formats. - before anyone says it, I know I could set up a generic, cross-browser-ready stylesheet for use with all my sites, and this is a system I already employ, I am simply concerned with saving bytesize and achieveing smaller stylesheets that are more easy to work with. I remember it was something like this: instead of: form{ margin:0px; padding:0px; } I'm sure you can do something like: form{ preformatting:none; } Does anyone know what I'm talking about? Or did I dream it?... cheers in advance Newbie question...I've always struggled with getting my links to show up right (hover styles, visited styles, etc.) In this case, I want my links to show up without an underline normally, but with an underline when hovered over. When they're visited, I don't want there to be any difference. I want them to show up normally. Right now I've got Code: .leftnavtext A:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #666666; text-decoration: none; } .leftnavtext A:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #666666; text-decoration: underline; } .leftnavtext A:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #666666; text-decoration: none; } .leftnavtext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #666666; } And when I hover over a visited link, it doesn't get underlined. Any idea why? Thanks. I have a page that I'm building as a prototype for a working medical exam GUI. I'm using Dreamweaver and it's pretty ugly. Is there anywhere I can download some styles that will bring this site to life? Maybe OSX or Vista-looking stuff? Hi, I'm trying to create a PDF of my site, and I want it to look EXACTLY like the site. Right now the links are coming out blue (instead of the color I've defined in my CSS), and the fonts are not displaying according to what I've defined in the CSS. Someone once told me that I can overlay the pages with a transparent gif and that would preserve my original CSS definitions. But I can't get that to work. If I add a <div> to the html page, in an effort to overlay a transparent image over the entire page, and then I convert it to a PDF, then in the PDF the big transparent image just moves to the bottom, underneath the rest of the page. Thanks to anyone who can maybe help. Laura S. Hi for some reason some style are getting lost when ie is displaying the page i am developing, if somone could have a look that would be fantastic edited links because question has been answered Thanks everyone I am looking for a way to implement CSS styles on DropDownList ListItems. In HTML it's pretty easy: PHP Code: <select> <option class="red" value= "Yes">Option 1</option> <option class="pink" value= "No">Option 2</option> </select> But in ASP.NET-VB I'm hitting a snag. PHP Code: <asp:dropdownlist id="ddlList" runat="server" Width="180px"> <asp:ListItem Value="Yes" class="red">Option1</asp:ListItem> <asp:ListItem Value="No" class="pink">Option2</asp:ListItem></asp:dropdownlist> That code doesn't work. When compiled, it totally deletes the "class" attribute. Any thoughts? Hi, I have an issue where my css loads fine with Safari and Firefox. However, I have no styling when it comes to any versions of IE. I have listed the code below. Any help would be greatly appreciated. (There is a bit of php, but css is not loaded through it). Code: <?php require_once("php/includes/sitewide.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title></title> <?php keywords(); ?> <?php description(); ?> <link href="css/sitestyle.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="menu"> <ul> <li class="active"><a href="<?php echo $link1; ?>"><?php echo $namelink1; ?></a></li> <li><a href="<?php echo $link2; ?>"><?php echo $namelink2; ?></a></li> <li><a href="<?php echo $link3; ?>"><?php echo $namelink3; ?></a></li> <li><a href="<?php echo $link4; ?>"><?php echo $namelink4; ?></a></li> <li><a href="<?php echo $link5; ?>"><?php echo $namelink5; ?></a></li> <li><a href="<?php echo $link6; ?>"><?php echo $namelink6; ?></a></li> <li><a href="<?php echo $link7; ?>"><?php echo $namelink7; ?></a></li> </ul> </div> <!-- end #menu --> <div id="header"> <h1><a href="<?php echo $link1; ?>"><?php echo $site_title; ?></a></h1> <h2 style="color: #FFFFFF;"><?php echo $statement; ?></h2> </div> <!-- end #header --> <div id="page"> <div id="content"> <div class="post hr"> <h1>Welcome to <em>Site Title</em></h1> <img src="images/building_1.jpg" alt="" width="120" height="120" class="left" /> <p><strong>SiteTitle</strong>performs home inspections that exceed the standards of the American Society of Home Inspectors. After accompanying us during the inspection, reading the inspection report, the client will know more about the home they are planning to purchase and quite often will know more about the condition of the house than the seller!*</p> </div> <div class="post"> <h2>Home Inspections</h2> <p><strong>Home Inspections</strong> are a necessity for homebuyers in South Carolina when purchasing a new or existing Home.*Potential homebuyers MUST be knowledgeable and informed of any and all problems that may exist prior to closing. The challenge is to find a qualified home inspector with the experience and knowledge of performing a thorough and comprehensive inspection of the property that the buyer can trust and can rely on the accuracy of the inspection.</p> <h3>Join Us</h3> <p>Join the hundreds of satisfied clients who have retained us to help them with their real estate transactions.</p> <blockquote> <p><?php quotes(); ?> </p> </blockquote> </div> </div> <!-- end #content --> <div id="sidebar"> <div id="updates" class="orangebox"> <h2><?php echo $header1; ?></h2> <ul> <li><a href="<?php echo $inspectlink_1; ?>"><?php echo $inspectname_1; ?></a></li> <li><a href="<?php echo $inspectlink_2; ?>"><?php echo $inspectname_2; ?></a></li> <li><a href="<?php echo $inspectlink_3; ?>"><?php echo $inspectname_3; ?></a></li> <li><a href="<?php echo $inspectlink_4; ?>"><?php echo $inspectname_4; ?></a></li> <li><a href="<?php echo $inspectlink_5; ?>"><?php echo $inspectname_5; ?></a></li> <li><a href="<?php echo $inspectlink_6; ?>"><?php echo $inspectname_6; ?></a></li> <li><a href="<?php echo $inspectlink_7; ?>"><?php echo $inspectname_7; ?></a></li> </ul> <h2><?php echo $header2 ?></h2> <ul> <li><a href="<?php echo $categorylink_1; ?>"><?php echo $categoryname_1; ?></a></li> <li><a href="<?php echo $categorylink_2; ?>"><?php echo $categoryname_2; ?></a></li> <li><a href="<?php echo $categorylink_3; ?>"><?php echo $categoryname_3; ?></a></li> <li><a href="<?php echo $categorylink_4; ?>"><?php echo $categoryname_4; ?></a></li> <li><a href="<?php echo $categorylink_5; ?>"><?php echo $categoryname_5; ?></a></li> <li><a href="<?php echo $categorylink_6; ?>"><?php echo $categoryname_6; ?></a></li> <li><a href="<?php echo $categorylink_7; ?>"><?php echo $categoryname_7; ?></a></li> </ul> </div> </div> <!-- end #sidebar --> <div style="clear: both;"> </div> </div> <!-- end #page --> <div id="footer"> <p id="legal"><?php echo COPYRIGHT; ?></p> </div> <!-- end #footer --> <?php analytics(); ?> </body> </html> Here is the css. Code: @charset "utf-8"; * { margin: 0; padding: 0; } body { background: #FFFFFF url(../images/img01.gif) repeat-x; text-align: justify; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; color: #666666; } h1, h2, h3 { color: #333333; } h1, h2 { margin-bottom: 20px; font-weight: normal; } h1 { font-size: 197%; } h2 { font-size: 152%; } h3 { font-size: 100%; } p, ul, ol { margin-bottom: 20px; line-height: 1.8em; } ul, ol { margin-left: 3em; } blockquote { padding-left: 3em; background: url(../images/img08.gif) no-repeat; font-style: italic; } a:link { color: #1953A7; } a:active { color: #ED5C0C; } a:visited { color: #666666; } a:hover { text-decoration: none; color: #067600; } img { border: none; } img.left { float: left; margin: 0 20px 10px 0; } /* Menu */ #menu { width: 770px; height: 65px; margin: 0 auto; border-right: 1px solid #EDEBD5; } #menu ul { margin: 0; padding: 0; list-style: none; } #menu li { display: inline; } #menu a { display: block; float: left; width: 109px; height: 45px; padding: 20px 0 0 0; border-left: 1px solid #EDEBD5; text-transform: lowercase; text-decoration: none; text-align: center; font-size: 144%; color: #BABABA; } #menu a:hover { background: #F7F7F4; } #menu .active a { background: #F49A24; color: #FFFFFF; } /* Header */ #header { width: 770px; height: 170px; margin: 0 auto; } #header h1 { float: left; width: 220px; height: 100px; margin: 0; padding: 70px 0 0 0; background: url(../images/header_left.jpg) no-repeat; text-align: center; font-size: 36px; } #header h2 { float: right; width: 530px; height: 86px; margin: 0; background: url(../images/header_right.jpg) no-repeat; padding: 84px 20px 0 0; text-align: right; } #header a { text-transform: lowercase; text-decoration: none; font-style: italic; font-weight: normal; color: #FFFFFF; } /* Page */ #page { width: 770px; margin: 0 auto; padding: 20px 0; } /* Content */ #content { float: left; width: 550px; padding-top: 10px; } #submitButton:hover { } .submitButton { border-width: 1px; padding: 5px; border-style: solid; margin: 5px; border-color: #000000; color: inherit; } .input { border-width: 1px; padding: 5px; border-style: solid; margin: 5px; border-color: #000000; color: inherit; } .inputSmaller { border-width: 1px; padding: 5px; border-style: solid; margin: 5px; border-color: #000000; color: inherit; } .post { margin-bottom: 20px; padding: 0 20px; } .hr { border-bottom: 1px solid #EDEBD5; } /* Sidebar */ #sidebar { float: right; width: 210px; padding: 5px; background: #EDEBD5; } #sidebar h2 { margin: 0; padding: 5px 15px; color: #FFFFFF; } #sidebar h3 { font-size: 85%; color: #FFFFFF; } #sidebar ul { margin: 0; padding: 15px; list-style: none; } #sidebar li { } #sidebar a { color: #FFFFFF; } .orangebox { background: url(../images/img05.gif) repeat-y; } .orangebox h2 { background: url(../images/img06.gif) repeat-y; } /* Footer */ #footer { clear: both; height: 100px; padding: 25px 0; background: #EDEBD5 url(../images/img04.gif) repeat-x; } #footer p { margin: 0; text-align: center; font-size: 77%; } #footer a { color: #666666; } I have a header.inc and a css style sheet that are called to each page of a website via php. In the style sheet there are two styles that I would like to change depending on the section of the website. For example: in the style sheet css id "subnav" has background: #E8EDF5 and cssi id "subtitle" has background #E8EDF5 however in each major section of the website I would like to change the background colors of the divs that have id "subnav" and "subtitle". Is there type of php statement that I could place at the top of my website pages that would allow me to specify the colors of these two css ids? Hope I have made this clear. This is the website I am working on: http://www.rookscommunications.com/projects/naturalne/index.html Everything is working fine, except the footer. When I view it in FireFox, I'm all set, but most likely most people will be using IE and that's where the problem is. Any thoughts on the bug? I've tied many different things. ALSO... to kill two birds with one stone. Could you peek at my javascript for random images...every now and then it selects a blank image and that's no good. Many Thanks Hi, I am having trouble setting up different link styles in my site. My code is: Code: .menu { font-family: Helvetica; font-size: 18px; color: #FFFFFF; } a.menu:link { color : #FFFFFF; text-decoration : none; } a.menu:visited { color : #FFFFFF; text-decoration : none; } a.menu:hover { color : #FFFFFF; text-decoration : underline; } a:link { color : #FFFFFF; text-decoration : underline; } a:visited { color : #FFFFFF; text-decoration : underline; } a:hover { color : #FFFFFF; font-weight : bold; text-decoration : underline; } From what I've read this should setup a default style for all links to follow, as well as define an alternate link style for anything in the menu class. So when I use the following code: <div class="menu"><I>01</I> <a href="">HOME</a></div> .. I would have thought the link would follow the style for .menu But it doesn't. It takes the style of the default links as well. How do I properly setup an alternate link style?? I am hacking a clients css. Can someone tell me where I am going wrong. His site is a Smarty one. Here is the meta tags. The website is www.russiansweets.us and I am trying to format the links in the right nav menu underneath the search function that are presently red. I added class A.one:{} Class but it seems not to make a difference. I get the same color links before as after (red) Code: <html> <head> link href="stylenew.css" rel="stylesheet" type="text/css"> {literal} <style> A { COLOR: red; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 11px; FONT-WEIGHT: bold; TEXT-DECORATION: none } A:hover { COLOR: #993300; FONT-SIZE: 11px; FONT-WEIGHT: bold; TEXT-DECORATION: none } // here is the part I added a.one { COLOR: #FFFFFF; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 13px; FONT-WEIGHT: bold; TEXT-DECORATION: none } a.one:hoover { COLOR: #FFFFFF; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 13px; FONT-WEIGHT: bold; TEXT-DECORATION: none } </style> //end of what I added {/literal} Here is the html Code: <td> <a class="one" href="disclaimer.php">Disclaimer</a> </td> I need a way to apply a different style to IE6 and IE7/Firefox. The webpage renders as expected in IE7/Firefox but IE6 needs to be fixed. Here is a mockup of what I need to have: Code: .featdesc { margin-left: 10px; margin-top: 10px; width: 400px; text-align: justify; if (ie6) font-size: 11pt; else font-size: 10pt; color: #505050; } Is there a way to accomplish this? |