CSS - Vert Align Text Against An Image
How do you vertically align some larger sized text with an image that is floating left inside a div?
The image is 152px in height and I set the div height to be 162px so there is padding of 5px around the image. Artoo Similar TutorialsHi all if you look here -> http://www.prxa.info/gol2/community.php to the right where it has status updates i wish the update itself to align to the top of the avatar images to the left of it? I'm having cross-browser compatibility with my website. On the right hand side I want to have images on the right and text to its left. I've tried variations of html/css but one seems to work with one browser and then not with the other. In safari it looks fine right now. http://www.ryanbuckley.ca/photos/ Can anyone help with this little annoyance? Thanks in advance! Ryan I am designing this page: theticketsguide.com/sample Scroll down to where the text reads, "Easy Navigation." I have (more or less) managed to vertically align this text with the image next to it, but I used padding instead of a cleaner, more exact "vertical-align" function. I've tried to put vertical-align:middle for the text, but it doesn't do anything. Any help as to what the right solution is to this? I don't want to use padding. Thanks, Brandon Hi! I'm in no way "new" to CSS and html, but I don't work with it on a regular basis. That said, what I'm trying to do, I would expect to work without too much trouble, but it's just not behaving like I'd expect. Seeing code is always a lot easier than trying to describe it, so here's the link to the page I'm trying to fix : chromocode.ca/test/ The issue I have is that the search box doesn't align with the image of the search button, even though they are the same height, and all elements (the input, the image, and its containing div) have 0 padding and 0 margin. I tried to put a top-margin of 2px on the image, that lowered the whole thing. Besides, it doesn't look exactly the same in IE7, Firefox and Chrome, so I don't want to start pixel-adjusting for each browser. Does anyone have any clue what I could do to fix this? Hi, I'm fairly new to CSS but I've been enjoying working with it. I've now stumbled onto a problem that is making me tear my hair out. I have a centered, fixed width 2-column design. and I'm trying to insert an image and float it left so that the text in the div wraps around it. The problem is that the image keeps being pushed down to the 3rd or 4th paragraph instead of the actual paragraph it's placed in. What could be causing this? I've included my code below. Thanks! Code: /*----------PAGE CENTERED AND FLUSH TOP-----*/ *{margin:0px; padding: 0px; } /*---------------BODY BACKGROUND------------*/ body{ background-color:#333333; } /*-----------BACKGROUND-CONTAINER-----------*/ #background-container{ width: 780px; background-color:white; margin: 0px auto; padding-top:0px; padding-bottom:0px; font-family:Arial; font-size:10pt; } /*-------HEADER ELEMENTS----------*/ #banner{ width: 780px; height: 200px; background-color:#CC9900; background-image:url(); border-bottom: 5px solid #333333; } #header{ width:770px; background-color:#FFFFFF; background-image:url(vertical-scanline.jpg); padding-left:10px; font-family: Arial; font-size:29px; font-weight: bold; } /*-----------BEGIN DROP-DOWN MENU--------*/ div#listmenu{ background-color:#860505; font: 10pt Arial; float:left; width:780px; margin: 0px auto; } div#listmenu ul{ margin: 0 0 0 30px; } *html div#listmenu ul{ float:left; border-left: 1px solid gray; margin-left:15px; } *html a{display:block; color:#FFFFFF;} div#listmenu li{ float:left; position:relative; background-color:#860505; list-style-type:none; padding: 0 6px; border-right:1px solid black; } div#listmenu ul li ul{ margin: 0px; position:absolute; width:10em;} div#listmenu ul li ul li{ width:100%; border-left: 1px solid gray; border-right: 1px solid gray; border-bottom: 1px solid gray; } div#listmenu li{first-child: border-left: 1px solid black; } div#listmenu ul li ul li {first-child: border-top: 1px solid gray; } div#listmenu a{ text-decoration:none; font-weight:bold; color:#ffffff; display:block; padding: 0 6px; background-color:#860505; } div#listmenu a:hover{ background-color:#FFFFFF; color:#000000; } body div#listcontainer ul li ul {display:none;} div#listcontainer ul li:hover ul { display:block; } div#listcontainer ul li:hover ul, div#listcontainer ul li ul:hover {display:block; z-index:25; } /*-----------END DROP-DOWN MENU--------*/ /*-----CLEARING ELEMENT BEGIN---------*/ .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} * html .clearfix {height: 1%;} .clearfix {display: block;} /*-----CLEARING ELEMENT END---------*/ /*--------------MAIN CONTENT---------*/ #main-container{ background-color:#ffffff; } /*----------COLUMNS--------*/ #sectionright{ width:190px; background-color:#860505; border-bottom: 5px solid #333333; font-family:Arial; font-size:14px; font-weight:bold; color:#FFFFFF; text-indent:20px; float:right; } #rightcol{ width:190px; background-color:#CCCCCC; font-family:"Arial"; color:#000000; font-size:12px; text-align: left; text-indent:20px; border-bottom: 5px solid #333333; padding:0px; float: right; clear:right; } #subscription{ width: 190px; background-color:#CC9900; border-bottom: 5px solid #333333; font-family:Arial; text-align:left; font-size:10px; margin-bottom:3px; float: right; clear:right; } #crisp{ width:190px; height:150px; background-color:#FFFFFF; border-bottom: 5px solid #333333; font-family:"Arial"; color:#000000; font-size:11px; text-align:left; float:right; clear:right; margin-bottom:3px; } #logo{ width:190px; height:90px; background-color:#FFFFFF; border-bottom: 5px solid #333333; float: right; clear:right; } #left-floater{ width:150px; padding-top:50px; float:right; background-color:#FFFFFF; font-size:11pt; } #floater-bottomleft{ width:150px; padding-top:50px; float:right; background-color:#FFFFFF; font-size:11pt; } #bottom{ width: 675px; clear:right; background-color:#FFFFFF; margin-top: 15px; margin-bottom: 15px; } #footer{ height:15px; width: 780px; background-color:#999999; font-family:"Arial"; font-size:10px; text-align:center; margin-top:5px; clear:right; } /*-----------BODY ELEMENTS-------*/ .subheader{ background-color:#D1A10D; font-family:"Arial"; font-size:19px; font-weight: bold; text-align:left; text-indent:5px; padding-top:5px; padding-bottom: 2px; } .pagesub{ background-color:#FFFFFF; font-family:"Arial"; font-size:16px; font-weight: bold; color:#860505; text-align:left; margin-top:5px; margin-bottom: 5px; } .column-title{ width: 190px; font-family:Arial; color: #000000; font-size: 14px; font-weight:bold; text-align: center; } div#main-container img { float:left; border: 1px solid #333; } /*------PARAGRAPH PROPERTIES-----*/ .p-main{ width:560px; margin-left:5px; padding-top:10px; padding-bottom:10px; text-align:justify; font-size:10pt; } ul{ padding-left:15px; list-style:none; } .pcolumn{padding-left: 40px;} .p-ul{font:10pt Arial;} .ptop{margin-bottom:5px;} /*----------------LINK PROPERTIES--------------*/ a:link{color:#000000; background-color:transparent;} a:visited{color:#CC0000; background-color:transparent;} a:active{color:#000000; background-color:transparent;} /*-----------RIGHT COL AND CRISP LINK PROPERTIES----*/ div#rightcol a:link{color:#000000; background-color:transparent;} div#rightcol a:visited{color:#CC0000; background-color:transparent;} div#rightcol a:active{color:#000000; background-color:transparent;} div#crisp a:link{color:#000000; background-color:transparent;} div#crisp a:visited{color:#CC0000; background-color:transparent;} div#crisp a:active{color:#000000; background-color:transparent;} /*------HTML BELOW-----*/ <body> <div id= "background-container"> <div id="listmenu"> <div id="listcontainer" class="clearfix"> <ul> <li><a href="http://www.crge.umd.edu">Home</a></li> <li><a href="#">Who We Are</a><ul> <li><a href="#">Director's Message</a></li> <li><a href="#">Staff</a></li> <li><a href="#">Faculty</a></li> <li><a href="#">Funders</a></li> <li><a href="#">Affiliates</a></li> </ul> </li> <li><a href="#">Research</a> <ul> <li><a href="#">Research Program Areas</a></li> <li><a href="#">Research Interest Groups</a></li> <li><a href="#">CrISP Research Training Program</a></li> <li><a href="#">Intersectional Research Database</a></li> </ul> </li> <li><a href="#">Publications</a> <ul> <li><a href="#">Research Connections 2007</a></li> <li><a href="#">Research Action Briefs</a></li> <li><a href="#">Campus Report</a></li> </ul> </li> <li><a href="#">Resources</a> <ul> <li><a href="#">Professional Opportunities</a></li> <li><a href="#">Alternative News Sources</a></li> <li><a href="#">Tools from Graduate Colloquium</a></li> </ul> </li> <li><a href="#">Events</a> <ul> <li><a href="#">Graduate Colloquium</a></li> <li><a href="#">QRIG Seminars</a></li> <li><a href="#">MC/VC Series</a></li> <li><a href="#">Calendar</a></li> </ul> </li> <li><a href="#">Media</a> <ul><li><a href="">Press Releases</a></li></ul> </li> <li><a href="#">Contact Us</a></li> </ul> </div> </div> <div id="header">The Consortium on Race, Gender and Ethnicity: CRGE</div> <div id="banner"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="780" height="200"> <param name="movie" value="CRGEbanner.swf"> <param name="wmode" value="transparent"> <embed wmode="transparent" src="CRGE%20banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="200"></embed> </object> </div> <div id="sectionright">Who We Are</div> <div id="rightcol"><p class="p-right"><b>In This Section</b></p> <p><ul> <li><a href="http://www.crge.umd.edu/about.html" target="_blank">Director's Message</a></li> <li><a href="http://www.crge.umd.edu/staff.html" target="_blank">Staff</a></li> <li><a href="http://www.crge.umd.edu/faculty.html" target="_blank">Faculty</a></li> <li><a href="http://www.crge.umd.edu/funders.html" target="_blank">Funders</a></li> <li><a href="http://www.crge.umd.edu/affiliates.html" target="_blank">Affiliates</a></li> </ul></p> <br> <br> </div> <div id="subscription"> <form method="post" action="http://www.emailmeform.com/fid.php?formid=35482"> <INPUT TYPE=hidden NAME=FCode VALUE="8gdrzytp"> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#CC9900"> <tr> <td> <font face="Arial" size="2" color="#000000">Subscribe to CRGE's Listserv</font> <div style="" id="mainmsg"> </div> </td> </tr> </table> <br> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF"> <tr valign="top"> <td nowrap><font face="Arial" size="2" color="#000000">Name</font></td> <td> <input type="text" name="FieldData0" value="" maxlength="100" size="20"> </td> </tr> <tr valign="top"> <td nowrap><font face="Arial" size="2" color="#000000"> Email</font></td> <td> <input type="text" name="FieldData1" value="" maxlength="100" size="20"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td></td> <td align="left"> <input type="text" name="hida2" value="" maxlength="100" size="3" style="display : none;"> <input type="submit" class="btn" value="Subscribe" name="Submit"></td> </tr> </table> </form> </div> <div id="logo"><p align="center"><img src="umlogo.gif"></p></div> <div id="main-container"> <p class="subheader">Director's Message</p> <p class="p-main"><img src="btdill2.jpg" width="150" height="175" />Welcome to the Web site for the Consortium on Race, Gender and Ethnicity.</p> <p class="p-main">The Consortium is an association of academic units and individual faculty on the University of Maryland campus whose mission is to promote, advance, and conduct research, scholarship, and faculty development that examines the intersections of race, gender, and ethnicity with other dimensions of difference.</p> <p class="p-main">Established in 1998 with support from the Colleges of Arts and Humanities, Behavioral and Social Sciences, the Graduate School, and the Office of the Provost, the Consortium seeks to: support, coordinate, and facilitate the activities of the many outstanding faculty and academic units at Maryland engaged in scholarship that focuses on intersections of race, gender, and ethnicity; and to build visibility both on and off-campus for our exceptional wealth of resources.</p> <p class="p-main">Through our affiliates, community partners, and research interest groups, we encourage an intellectual climate that supports collaboration. Through our Research Program Areas, we promote approaches that contextualize the lives and experiences of the individuals and groups that participate in our research. Through this Web site and other dissemination efforts, we develop applications of knowledge to human problems. Through a variety of research training opportunities we seek to transfer intellectual capital to upcoming generations.</p> </div> <div id="footer"><p>Home | Who We Are | Research | Publications | Resources | Events | Media | Contact Us</p></div> </div> </body> In IE6, the vertical scrollbar disappears if the browser window is opened vertically past the <div id="text intro"> section (if the bottom of the browser window is within or above this section, the scroll bar is present). The scrollbar is present as normal in FF and Safari. So this is apparently an IE issue. I've tried a couple of fixes to seemingly related bugs, such as adding the line "display:inline;" to both of my floating elements. I also tried the Holly Hack fix of adding "height:1%" to my relatively positioned element, "body". The scrollbar behavior remains the same. The following are my .php and .css files. Any ideas on this would be much appreciated... thanks. PHP 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=iso-8859-1" /> <link href="test.css" rel="stylesheet" type="text/css" /> </head> <title>Title</title> <body> <div id="container"> <div id="address">Address</strong></div> <div id="banner">Banner<div id="logo"></div> <div id="redseethru" class="redseethru"></div> <div class="redseethru" id="links"></div> <div id="link1">Link</div> <div id="link2">Link</div> <div id="link3">Link</div> <div id="link4">Link</div> <div id="link5">Link</div> </div> <div id="breadcrumbs">Script </div> <div id="red_title">Products</div> <div id="title">Kayaks</div> <div id="body"> <div id="text_intro">Text</div> <p>ipsum lorem</p> <p>ipsum lorem</p> <p>ipsum lorem</p> <p>ipsum lorem</p> </div> <div class="redseethru" id="footer"></div> <div id="copyright">Copyright</div> <div id="silver">Design</div> </div> </body> </html> CSS: PHP Code: /* CSS Document */ #container { position:absolute; width:750px; left:50%; margin-left:-350px; } #address { position:absolute; width:615px; height:12px; z-index:10; left: 165px; top: 0px; font-family: Arial; font-size: 11px; color: #FFFFFF; padding-top: 1px; padding-bottom: 1px; } #banner { position:absolute; width:750px; height:125px; z-index:1; left: 0px; top: 50px; background-image: url(http://www.sportingrage.com/js/banner_images.js); border: 2px solid #CF1C0D; } #logo { position:absolute; width:285px; height:150px; z-index:2; left: -40px; top: -49px; visibility: visible; background-image: url(http://www.sportingrage.com/images/TSR_white_SML.png); } img, #logo { behavior: url(http://www.sportingrage.com/iepngfix.htc); } body { background-color: #000033; } .redseethru { position:absolute; width:150px; height:100px; z-index:3; left: 602px; top: 0px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='http://www.sportingrage.com/images/redseethru.png'); } .redseethru[class] { background-image: url(http://www.sportingrage.com/images/redseethru.png); } #red_title { position:absolute; width:145px; height:25px; z-index:10; left: 598px; top: 120px; text-align: right; font-family: Arial; font-size: 24px; font-weight: bold; color: #FFFFFF; } #links { position:absolute; width:750px; height:25px; z-index:5; left: 0px; top: 100px; border-top: 1px solid #CF1C0D; } #link1 { position:absolute; width:74px; height:15px; z-index:10; font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; padding: 5px; left:2px; text-align: center; border-right: 1px solid #CF1C0D; top:100px; } #link2 { position:absolute; width:74px; height:15px; z-index:10; font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; padding: 5px; left: 87px; text-align: center; border-right: 1px solid #CF1C0D; top:100px; } #link3 { position:absolute; width:74px; height:15px; z-index:10; font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; padding: 5px; left: 172px; text-align: center; border-right: 1px solid #CF1C0D; top:100px; } #link4 { position:absolute; width:74px; height:15px; z-index:10; font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; padding: 5px; left: 258px; text-align: center; border-right: 1px solid #CF1C0D; top:100px; } #link5 { position:absolute; width:74px; height:15px; z-index:10; font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; padding: 5px; left: 342px; text-align: center; border-right: 1px solid #CF1C0D; top:100px; } /*White Links*/ a.white:link { font-family: Arial; color: #ffffff; text-decoration: none; } a.white:visited { font-family: Arial; color: #ffffff; text-decoration: none; } a.white:hover { font-family: Arial; color: #ffffff; text-decoration: underline; } #breadcrumbs { position:absolute; width:730px; height:20px; z-index:1; font-family: Arial; font-size: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 10px; left: 0px; top:179px; background-color: #FFFFFF; border-right-width: 2px; border-left-width: 2px; border-right-style: solid; border-left-style: solid; border-right-color: #FF0000; border-left-color: #FF0000; text-indent: 7px; } a.breadcrumbs:link { color:#000033; text-decoration:underline; font-weight: normal; font-family: Arial; font-size: 10px; } a.breadcrumbs:visited { color:#000033; text-decoration:underline; font-weight: normal; font-family: Arial; font-size: 10px; } a.breadcrumbs:hover { color:#000033; text-decoration:underline; font-weight: normal; font-family: Arial; font-size: 10px; } #title { position:absolute; width:740px; height:20px; z-index:1; font-family: Arial; font-size: 20px; padding-right: 5px; padding-left: 5px; padding-top: 10px; left: 0px; color: #000033; font-weight: bold; text-align: left; padding-bottom: 5px; top: 214px; background-color: #FFFFFF; text-indent: 10px; border-right-width: 2px; border-left-width: 2px; border-right-style: solid; border-left-style: solid; border-right-color: #FF0000; border-left-color: #FF0000; } #body { position:relative; width:730px; height:1%; z-index:6; left: 0px; top: 249px; background-color: #FFFFFF; border-top: 2px none #CF1C0D; border-right: 2px solid #CF1C0D; border-bottom: 2px solid #CF1C0D; border-left: 2px solid #CF1C0D; padding: 10px; } #text_intro { position:relative; width:650px; height:50px; z-index:10; font-family: Arial; font-size: 12px; padding-right: 40px; padding-left: 40px; padding-top: 10px; left: 10px; color: #000033; text-align: left; padding-bottom: 5px; top: 10px; } #footer { position:relative; width:750px; height:20px; z-index:4; left: 0px; top: 249px; border-top: 2px none #CF1C0D; border-right: 2px solid #CF1C0D; border-bottom: 2px solid #CF1C0D; border-left: 2px solid #CF1C0D; padding-top: 5px; } #copyright { position:relative; float:left; top:249px; width:200px; height:25px; z-index:17; font-family: Arial; font-size: 11px; color: #FFFFFF; display:inline; } #silver { position:relative; float:right; width:200px; height:25px; z-index:7; top: 249px; font-family: Arial; font-size: 11px; color: #FFFFFF; display:inline; } OK, I have a few links stacked vertically and I'm trying to get them to align to the right. You can see the links here Please look at the sub navigation to the left of the big image. My CSS looks like this: Code: a.subnav{ font-family:arial,helvetica, sans-serif; font-size:11pt; color:#FFFFFF; line-height:24px; text-decoration:none; text-align:right; } what am I doing wrong? How can I get the text to align to the right? - thanks Hi there, ahhhh I have just decided to start using Firefox and now am rreworking my site. All new set up issues to try and fix and i don't even know where to start. Here is my site: www.kohlrbaby.com The issues: 1) nav bars are no longer positioned correctly vertically, nor can I get the text to center in FF 2) the white box extends longer then it should in FF vs IE 3) the text is extending off the white box in the catalogue area in FF please please offer me some css insight here is my .css code: BODY { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-TOP: 0px; PADDING-BOTTOM: 0px; margin:0px auto; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #a1b7d2; SCROLLBAR-FACE-COLOR: #a1b7d2; SCROLLBAR-ARROW-COLOR: #003366; SCROLLBAR-TRACK-COLOR: #cccccc; FONT-FAMILY: verdana, helvetica, arial, sans-serif; BACKGROUND-COLOR: #a1b7d2; TEXT-ALIGN: center; COLOR: black; FONT-SIZE: 12px; } #menuList { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px } #menuList UL { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px } #menuList LI { DISPLAY: inline; LIST-STYLE-TYPE: none } A.actuator { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 9px; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #000; PADDING-TOP: 0px; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none } A.actuator:hover { COLOR: #958550 } .menu { BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; VISIBILITY: hidden; BORDER-LEFT: #ccc 1px solid; COLOR: #000; BORDER-BOTTOM: #ccc 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff } .menu LI A { PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; FONT-SIZE: 9px; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #000; LINE-HEIGHT: 1.75em; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff; T EXT-DECORATION: none } .menu LI A:hover { COLOR: #eee; BACKGROUND-COLOR: #a1b7d2 } SPAN.key {TEXT-DECORATION: underline} #homeMenu {WIDTH: 100px} #catalogueMenu {WIDTH: 100px} #wholesaleMenu {WIDTH: 100px} #wheretobuyMenu {WIDTH: 100px} #contactMenu {WIDTH: 100px} A {FONT-WEIGHT: normal; COLOR: #000000; TEXT-DECORATION: none } A:visited {COLOR: #000000} A:hover {COLOR: #958550} A.set1:link {text-decoration: none; color: #7c8895 } A.set1:visited {text-decoration: none; color:#990000} A.set1:hover {text-decoration: none; color:#958550} #navHeader { PADDING-TOP: 0; HEIGHT: 110px; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; WIDTH: 650px; POSITION: relative; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center; z-index: 10; } #logoHolder{ position: relative; } img.nav_left{ float: left; } #smallLogo { POSITION: relative; top: 30px; left: -145px; font size: 11px; font-weight: bold; } div.gray_layer { background:#cccccc; height: 20px; width: 650px; border: solid #000000; border-right-width: 0px; border-left-width: 0px; border-top-width: 1px; border-bottom-width: 1px; position: relative; text-align: center; z-index: 50; top: 56px; } #second_links { FONT-SIZE: 9px; TEXT-ALIGN: center; position: relative; top: 58px; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; margin:0px auto; } #navImageBox{ BORDER-RIGHT: #000000 1px solid; BORDER-TOP: 0px; BORDER-LEFT: #000000 1px solid; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; WIDTH: 650px; POSITION: relative; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center; } #verticalLine{ height: 12px; width: 500px; border-right:#000000 1px solid; } img.banner{ BORDER-TOP: #000000 1px solid; BORDER-bottom: #000000 1px solid; } #contentHolder{ PADDING-TOP: 0; PADDING-bottom: 0; PADDING-left: 0; PADDING-right: 0; BORDER-RIGHT: #000000 1px solid; BORDER-Bottom: #000000 1px solid; BORDER-LEFT: #000000 1px solid; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; WIDTH: 650px; POSITION: relative; BACKGROUND-COLOR: #ffffff; text-align: center; } #text{ padding: 10 30 0 30; line-height: 1.75em; text-align: left; } #catalogue{ padding: 20 30 15 25; width: 650px; position:relative; height: 100%; background:transparent; margin-right: auto; margin-left: auto; } .outline {border: 1px solid black;} div.catalogue_pic { position: relative; float: left; padding-right: 8px; } div.catalogue_text{ text-align: left; position: relative; LINE-HEIGHT: 1.25em; } div.float { position: relative; float: left; margin: 5 5 5 5; } div.float p { text-align: center; } #bottomText{ padding: 0px; margin-top: 10px; margin-bottom: 0px; margin-right: 20%; margin-left: 20%; /* opera does not like 'margin:20px auto' */ background: none; border: none; border-top: none; text-align:center; voice-family: "\"}\""; voice-family:inherit; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; } #blueBox{ text-align: center; position: relative; height: 27px; width: 150px; background-COLOR: #a1b7d2; top: -26px; } OK I have a layer that is described here : div#footer { position: absolute; top: 0; left: 0; width: 100%; height:14; background-color: #EED; font: 10px Verdana, sans-serif;} In this layer I wish to have some text in the left of the bar and at the far right (align-right) some text also ... how would i achieve this ??? -Thanks- I'm creating a dynamic calendar and I can't get the numbers in the cells of my calendar table to align top-right! Here is my unformatted table... Code: <tr height="75"> <td><div align="right">12</div></td> <td><div style="vertical-align:top; text-align:right">13</div></td> <td>14</td> <td>15</td> <td>16</td> <td>17</td> <td>18</td> </tr> I want the numbers to be aligned top right, but if I put other data in there(currently there is none, but there will be), I'd like it to be aligned left. I tried using the vertical-align property in a div tag, but that didn't do anything... I can get it to align right with a div tag... sorry if it's such a stupid quesiton... Also, a side note... I thought that span allows you to align text as well using the style property, but that doesn't work at all (not even just to the right) I have both Chinese characters and English characters in one paragraph, but they don't align to the bottom with the English characters appearing like <sup>. I have used 'vertical-align' to align the text, but not successful. Pls help. I have the following CSS: Code: span.title { {color:#c38ec7;text-decoration: underline;font-family: forte;font-variant:small-caps;font-weight:bold;font-size:165%} } ... it works fine but when I try and put 'text-align:center;' that attribute does not seem to work. Is there any way of doing this??? Thanks I have some text in a DIV that is updated dynamically with removeChild() and appendChild(). I've tried numerous combinations but I can't seem to get it to work correctly. CSS Code: Original - CSS Code div.chatlayer { position: absolute; top: -50px; left: 50px; border: 1px solid black; -moz-border-radius: 10px; padding: 5px; background-color: white; min-width: 100px; width: auto; text-align: center; visibility: hidden; } div.chatlayer { Confused yet? What's the best way to accomplish this? page testimonials.css Main.CSS If you look at the page, you will see that I have the "signature" of the testimonial giver aligned right, but I would like the two p elements to be aligned along their left edge as well (but on the right side of the page, with everything flowing around any images)... I tried floating them right, which and clearing the floats, but then the testimonials don't flow around the images... can this be done without getting divitis? Please look at this page - http://www.tmhdesign2.com/home-payment-calculator.asp Why can I not justify the paragraph of text on this page for Firefox??? Hi, The text in my navigation bar is slightly off-centre, even though I have applied the text-align:centre property in my style sheet. Is there anything obvious that would be throwing it off? Any help would be greatly appreciated. Jimmy Here is my style sheet: body { padding:0px; margin:0px; background-color:#ffffff; background-image:none background-repeat:no-repeat; font-family:verdana, arial, Helvetica, sans-serif; font-size:11px; color:#333; } /*--------------------DIVs------------------------------*/ div#pagecenter { margin: 0 auto; width: 1024px; background-color:#ffffff; } div#header { height:312px; background-color:#ffffff; background-repeat:no-repeat; background: ((address blocked: See forum rules)); padding:5px; text-align:right; text-display: none; color:#FFFFFF; } div#desc { visibility: hidden; text-align:left; } div#sitename { visibility: hidden; } div#oup h1 a { margin-top: -30px; margin-left: 10px; margin-right: auto; width: 100px; height: 30px; display: block; font-size: 0px; color: #003261 } div#oup h1 a:hover {color: #003261} div#clickableheader h1 a { margin-top: 20px; width: 1000px; height: 200px; display: block; font-size:0px; color: #003261; } div#clickableheader h1 a:hover {color: #003261} /* nav */ #nav { width: 400px; margin-left: 0px; margin-right: auto; margin-top: -70px; line-height: 20px; height: 100px; text-align: center; font-size: 12px;} #nav ul {list-style-type: none;} #nav li {display: block; float:left; width: 50px; padding: 40px 20px 40px 25px; border: none; background: url("images/DBlueUp.jpg") no-repeat;} #nav li.page-item-6 {padding: 23px 20px 20px 25px; border: none; background: url("images/PU.jpg") no-repeat;} #nav li.page-item-6.current_page_item {padding: 23px 20px 20px 25px; border: none; background: url("images/PD.jpg") no-repeat;} #nav li.current_page_item {border: none; background: url("images/DBD.jpg") no-repeat;} #nav li.page-item-51 {text-align: center; padding: 20px 25px 20px 20px; border: none; background: url("images/GreenUpCentre.png") no-repeat;} #nav li.page-item-51 a {text-align: center;} #nav li.page-item-51.current_page_item {padding: 20px 25px 20px 15px; border: none; background: url("images/GD.jpg") no-repeat;} /* navright */ #navright { width: 400px; margin-left: auto ; margin-right: 0px ; margin-top: -110px ; line-height: 20px; height: 100px; text-align:center; font-size: 12px;} #navright ul {list-style-type: none;} #navright li {display: block; float:left; width: 50px; padding: 20px 20px 20px 20px; margin: 5px; border: none; background: url("images/LBU.jpg") no-repeat;} #navright li.page-item-2 {border: none; background: url("images/OU.jpg") no-repeat;} #navright li.page-item-2.current_page_item {border: none; background: url("images/OD.jpg") no-repeat;} #navright li.page-item-48.current_page_item {border: none; background: url("images/LBD.jpg") no-repeat;} #navright li.page-item-13 {padding: 20px 20px 40px 20px; border: none; background: url("images/contact.jpg") no-repeat;} div.left-navi-blog { width:255px; margin-right:10px; float:left; } div.left-widget { width:255px; margin-top:40px; background-color:#ffffff; padding-top:1px; padding-bottom:200px; } div#leftbarfooter { background-color:ffff00; height:15px; } div#rightbarfooter { background-image:none; height:15px; } div.center-gauche-area { width:755px; margin-right:10px; float:left; margin-top:-50px; } div.center-blog { width:500px; margin-right:10px; float:left; margin-top:-0px; } div.post-title { visibility: hidden; margin:0px; padding:5px; height:16px; background-color:#FFFFFF; } div.post-content { background-color:#FFFFFF; margin:0px; padding:5px; text-align:center; border-top:#000000 0px solid; border-bottom:#000000 0px solid; } div.post-meta { color:#FFFFFF; margin:0px; padding:4px; height:14px; margin-bottom:10px; background-color: #ffffff; } div.single-meta { border:#444 1px dashed; padding:2px; margin:5px; margin-top:10px; color:#202D32; background-color:#B0BDC5; font-size:10px; } div.main-meta { border:#ccc 1px dashed; padding:2px; margin:5px; margin-top:10px; color:#666; background-color:ddd; font-size:10px; } div.commentblog { background-color:#B0BDC5; margin:0px; padding:5px; text-align:center; border-top:#000000 1px solid; border-bottom:#000000 0px solid; } div.singlecommentborder { float:left; } div.gravatorblog { float:left; width:70px; } div.singlecomment { float:left; width:410px; } div.right-navi-blog { width:200px; float:left; } div.right-widget { margin-top:80px; width:200px; background-color:#ffffff; padding-bottom:4px; padding-right:5px; } div.widget-header { color:#000000; font-weight:bold; padding-left:10px; padding-top:3px; } div.clear { clear: left; margin: 0; padding: 0; height: 0; line-height: 0; font-size: 0; } div#sharebar { margin-right:auto; margin-left:auto; margin-bottom:0px; background:#fff; height:30px; padding:25px; color:#003261; } div.ouplegal { margin-top:0px; background:#cbeefe; height:12px; text-align:center; padding:5px; color:#003261; font-size:10px; } div#footer { margin-top:0px; background:#003261; height:40px; text-align:center; padding-top:20px; color:white; font-size:16px; } div#footer :link {text-decoration:underline} /*--------------------textgestaltung--------------------*/ p{ margin:0px; } h1,h2,h3,h4,h5,h6{ color:#000000; margin:0px; padding:0px; font-size:11px; } acronym, abbr, span.caps { cursor: help; } acronym, abbr { } blockquote { } blockquote cite { } hr { } dl{ } dt{ } dd{ } ul { margin:0px; margin-left:12px; list-style:none; padding-left:8px; } ol{ } li { list-style:square; margin-top:3px; padding-top:2px; padding-bottom:2px; color:#810000; } ul ul{ } blockquote{ } blockquote p{ } code{ } pre{ } b, strong,i,em { } img{ padding:3px; margin:2px; } address { } img.ogtzuq{ border:0px; color:#3B4D56; } /*--------------------linkgestaltung--------------------*/ a {text-decoration:none; color:#FFFFFF; } a:link { text-decoration:none; color:#FFFFFF; } a:visited { text-decoration:none; color:#FFFFFF; } a:link:focus{ } a:link:hover, { font-weight: bold; } .post-content a{ color:#333; } .post-content a:link { color:#333; } .post-content a:visited{ color:#333; } .post-content a:link:active, .post-content a:visited:active{color:#333; } #single-meta a{ color:#333; } #single-meta a:link { color:#333; } #single-meta a:visited{ color:#333; } #single-meta a:link:active, #single-meta a:visited:active{color:#333; } .commentblog a{ color:#333; } .commentblog a:link { color:#333; } .commentblog a:visited{ color:#333; } .commentblog a:link:active, .commentblog a:visited:active{color:#333; } /*--------------------bilder als links--------------------*/ a img{ padding:3px; margin:2px; } a:link img { } a:visited img { } a:link:active img, a:visited:active img { } a:link:hover img, a:visited:hover img { padding:3px; margin:2px; } /*--------------------smilies im text--------------------*/ body img.wp-smiley{ } /*--------------------der weiterlesen link--------------------*/ .more-link{ } /*--------------------die seiten wenn es mehrere gibt--------------------*/ p.serif{ } /*--------------------suche--------------------*/ #searchform{ } input#s{ } input#searchsubmit{ } /*--------------------Kommentare--------------------*/ .alt { } .commentlist { padding:0px; margin:0px; } .nocomments { text-align:center; } .commentlist li { padding:0px; margin:0px; list-style:none; color:#111; } .commentlist cite, .commentlist cite a { } .commentlist p { text-align:center; padding:0px; padding-top:5px; } #commentform p { } .commentmetadata { } #commentform input { border:1px solid #333; margin-bottom:3px; } #commentform textarea { border:1px solid #333; width:488px; } #commentform #submit { } /*--------------------fuer den wp kalender--------------------*/ #wp-calendar th { } #wp-calendar { empty-cells: show; } #wp-calendar #next a { } #wp-calendar #prev a { } #wp-calendar a { } #wp-calendar caption { } #wp-calendar td { } #wp-calendar td.pad:hover { } /*-------------------- widgets---------------------*/ h2.widgettitle{ } .widget { } /*--------------------Archive--------------------*/ li#archives{ } .widget_archives{ } /*--recent posts--*/ li#recent-posts{ } .widget_recent_entries{ } /*--------------------text widget--------------------*/ li.widget_text{ } /*--id haengt von der nummer des text widgets ab*/ li#text-4{ } div.textwidget{ } /*--------------------links blogroll--------------------*/ li#links{ } .widget_links{ } /*--------------------kategorien--------------------*/ li#categories{ } .widget_categories{ } /*-------------------WP Requires------------------*/ .aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignleft { float: left; } .alignright { float: right; } .wp-caption { border: 1px solid #ddd; text-align:center; background-color: #f3f3f3; padding-top: 4px; margin: 10px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .wp-caption img { margin: 0; padding: 0; border: 0 none; } .wp-caption-dd { font-size: 11px; line-height: 17px; padding: 0 4px 5px; margin: 0; } How do I align the text in my navbar vertically? I'm trying to do this. edit.... I can't post the link by adding vertical-align:middle; to my navbar tag and its not working. Do you see where i'm going wrong? I have a row of icons (for navigation, with a text description underneath them) I am trying to break out of table design so I want these divs aligned next to each other, with the image/text centered. Everything looks pretty peachy... but in FF the text such as "Candidates" underneath the icon floats to the left because of the parent float.. it ignores the text-align: center. In other browsers it works but not in FF any help? Also if anyone has a better way of writing this code I would be open to suggestions since I am slowly breaking away from table design. Thanks! Code: .main #header { background: #FFFFFF; padding: 0 10px 0 10px; border-bottom: 1px solid black; border-top: 1px solid black; } .icon_nav{ font-size: 12px; float: left; text-align: center; margin-right: 12px; border: 1px solid black; } Code: <div id="header"> <div style="float: left"> <img src="images/logo.png" align="left" style="margin-right: 4px"/> <div style="color: #992204; font-size: 18px">XYZ Company</div> <div style="color: #992204; font-size: 14px">Professional Company</div> <div style="color: #992204; font-size: 12px">481-555-5555</div> </div> <div style="float: right;"> <div class="icon_nav"><img src="images/icons/home.png" /><br />Home</div> <div class="icon_nav"><img src="images/icons/employers.png" /><br />Employers</div> <div class="icon_nav"><img src="images/icons/candidates.png" /><br />Candidates</div> <div class="icon_nav"><img src="images/icons/directions.png" /><br />Directions</div> <div class="icon_nav"><img src="images/icons/event_planning.png" /><br />Event Planning</div> <div class="icon_nav"><img src="images/icons/contactus.png" /><br />Contact Us</div> </div> <br style="clear: both;" /> <!-- end #header --> </div> Hi, I have a list of items a bullet on the left --> check.gif (13 X 12) and I'm totally new with CSS... but my check aligns ok only with IExplorer, firefox doesn't. here is my code... Code: #myul { color: #000000; font-family: Calibri, Geneva, Arial, Helvetica, sans-serif; list-style-position: outside; margin-left: 15%; margin-right: 15% } #myul li { color: #0076a3; font-family: Calibri, Geneva, Arial, Helvetica, sans-serif; background-repeat: no-repeat; background-image: url(images/check.gif); } Code: <ul id="myul" class="listObj"> <li class="style16">Test item 1</li> <li>Checks all devices</li> <li>Verifies ....quality, ....resolution, precision/accuracy</li> <li>Compares current imagesbla bla bla bla bla bla bla bla bla some more below.........................ok thanks</li> </ul> PLEASE NOTE that I want the check align on top, sometimes the text lenght makes it move, I don't want that to happen. Can you help Thanks, my first post here I saw the layout of the table that have 2 columns where everything is aligned to the left in both columns. Since I have to do the CSS without a table where the 1st column is questionings and the 2nd column is form's textboxes & drop-down selection. So, how do I get them lined up for the make-believe columns?? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Customer/Prospect Feedback And Information Request Form</title> <style type="text/css"> body { margin: 10px 0px 10px 25px; padding: 0px; background-color: #<?=$bg_color;?>; color: #<?=$text_font;?>; font-family: verdana, sans-serif; font-size: 8pt; font-style: normal; font-weight: bold; text-align: left; } div.divCenterLayout { margin: 0px; padding: 0px; } </style> <script type="text/javascript"> //Rest of lengthly codes here is removed for forum viewing.... </script> </head> <body> <div class="divCenterLayout"> <form name="Feedback" action='abc_info.php?FirstName?LastName?MiddleInitial?Title?Company?StreetAddress?Address2?City?Stat e?ZipCode?Country?WorkPhone?Fax?email?Product?How?RCPT?Message?WebColor?FontColor?FromWho?WhichWeb' onsubmit="return ValidateForm(document.Feedback);" method="POST"> <script type="text/javascript"> //Break up addresses to prevent spam spiders from indexing them... var user1 = "feedback"; var site1 = "<?=$from_who?>"; document.write('<input type=\"hidden\" name=\"FromWho\" value=\"' + user1 + '@' + site1 + '\">'); </script> <input type="hidden" name="WebColor" value="<?=$bg_color?>"> <input type="hidden" name="WhichWeb" value="<?=$which_website?>"> <input type="hidden" name="FontColor" value="<?=$text_font?>"> Please provide us with the following information: <span style="font-weight:normal;">(note: fields with * are required)</span><br> <br> First Name:* <input size="25" name="FirstName"><br> Last Name:* <input size="25" name="LastName"><br> Title: <input size="25" name="Title"><br> Company:* <input type="TEXT" size="35" name="Company"><br> Street Address: <input type="TEXT" size="35" name="StreetAddress"><br> Address (cont.) <input type="TEXT" size="35" name="Address2"><br> City: <input type="TEXT" size="25" name="City"><br> State/Province: <input type="TEXT" size="25" name="State"><br> Zip/Postal Code: <input type="TEXT" size="12" name="ZipCode" maxlength="12"><br> Country: <input type="TEXT" size="25" name="Country"><br> Work Phone:* <input size="12" name="WorkPhone"> (Minimum of 10 digits)<br> Fax: <input size="12" name="Fax" maxlength="25"> (Minimum of 10 digits)<br> E-Mail:* <input size="25" name="email"><br> <br> Select 1 or More Products You're Interested In:*<br> <br> <!-- Product name is changed to product numbering --> <input type="checkbox" name="product 1" value="1"<?=$productChecked2;?>> Product 1 <input type="checkbox" name="product 2" value="1"<?=$productChecked3;?>> Product 2 <input type="checkbox" name="product 3" value="1"<?=$productChecked4;?>> Product 3 <br> <input type="checkbox" name="product 4" value="1"<?=$productChecked5;?>> Product 4 <input type="checkbox" name="product 5" value="1"> Product 5 <input type="hidden" name="Product"> <br> <br> <br> How Did You Hear About Us?:* <select size="1" name="How"> <option selected value="none">Please Select From The Choices ...</option> <option value="Direct Mail">Direct Mail</option> <option value="Internet">Internet</option> <option value="Magazine Ad">Magazine Ad</option> <option value="Newspaper Ad">Newspaper Ad</option> <option value="Referral">Referral</option> <option value="Word of Mouth">Word of Mouth</option> <option value="Other">Other</option> </select><br> Send response to:* <select size="1" name="RCPT"> <option selected value="none">Please Select From The Choices ...</option> <script type="text/javascript"> //Break up addresses to prevent spam spiders from indexing them... var user2 = "marketing"; var user3 = "software"; var user4 = "hardware"; var user5 = "webmaster"; var site2 = "companyName.com"; document.write('<option value=\"' + user2 + '@' + site2 + '\">Sales/Marketing</option>'); document.write('<option value=\"' + user3 + '@' + site2 + '\">Software Support</option>'); document.write('<option value=\"' + user4 + '@' + site2 + '\">Hardware Support</option>'); document.write('<option value=\"' + user5 + '@' + site2 + '\">Webmaster</option>'); </script> </select><br> <br> Your message*: <span style="font-weight:normal;">(please do not use special characters)</span><br> <br> <input type="submit" value="Send" border="0"><br> <br> <input type="reset" value="Clear" border="0"><br> <textarea rows="3" cols="40" wrap="virtual" name="Message"></textarea><br> </font> </form> </div> </body> </html> |