CSS - Newbie ! Need To Align
Edited
Similar Tutorialshi all. i am trying to leave the world of table formatting and need a bit of help i have a container div with two divs in it the first div has an image in it that should sit at the bottom, like so: _____________________ logo div ____IMG______________| __nav div_____________| i have the following code as my css: #container{ margin-left:60px; border:1px dotted black; } #logo{ margin-top:60px; width: 395px; height: 140px; background-color:#EBEBEB; padding: 10px 0px 0px 20px; } #nav{ margin-top:5px; height: 25px; width: 395px; background-color:#FFFF00; padding: 10px 0px 0px 20px; } img { display: block; border: 0; } img.bt { display: block; vertical-align: bottom; } and my html: <div id="container"> <div id="logo"><img src="i/logotype.gif" class="bt"></div> <div id="nav">Practice Areas | Firm Profile | News | Attorneys</div> </div> it is not vertical aligning to bottom. can anyone help me? i am testing on mac ie5 and safari for super @ssyness!! but i want it to work everywhere if possible. i am sure it is something simple, but im not sure what it is thanks a lot everyone. Hello and thanks for your patience. I have a page here that is having a positioning problem for "sidebar2". I can't seem to get it to stick to that right side of the page in a fixed position. Code: @charset "UTF-8"; * { margin: 0px; padding: 0px; } body { text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 0.8em; color: #32240C; line-height: 1.5em; } a:link { color:#C42617; } a:hover { color: #687ABB; } a:visited { color:#C42617; } a:active { color: #687ABB; } h2 { font-size: 1.2em; line-height: 2.3em; color: #34260b; border-left-width: thin; border-left-style: double; border-left-color: #34260b; text-indent: 10px; background-repeat: no-repeat; } #clear { clear: both; } #welcome { color: #325084; float: left; width: 590px; text-align: left; padding: 15px; border: thin solid #D0DAEF; background-color: #FFF; margin-left: 25px; margin-right: 5px; } #welcome h2 { padding-left: 2px; } #welcome p { padding-left: 2px; } input { width: 185px; } /* reset width for non-text inputs */ input.radio, input.checkbox, input.submit, input.dropdown { width:auto; } /* display labels next to form elements add a class for when you want them to stack */ label { float: left; margin-right: 1em; } label.top { display: block; float: none; } .sidebar2 { position:absolute; top:182px; right: 150px; text-align:left; width: 255px; padding-top: 0px; padding-right: 0; padding-bottom: 10px; padding-left: 10px; margin-top: 0px; } .sidebarheader { color:#D75500; padding-bottom: 5px; font-weight: bold; font-style: italic; font-size: 16px; } ul { list-style: none; margin: 0; padding: 0; } img { border: none; } /*- Menu 3--------------------------- */ #menu3 { width: 250px; border-style: solid solid none solid; border-color: #BCD2E6; border-size: 1px; border-width: 1px; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; font-size: 12px; } #menu3 li a { height: 32px; voice-family: "\"}\""; voice-family: inherit; height: 24px; text-decoration: none; } #menu3 li a:link, #menu3 li a:visited { color: #325084; 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; } #affiliates { color: #325084; float: left; width: 580px; text-align: left; margin-left: 25px; margin-right: 15px; } #affiliates table td { padding: 15px; } Can you tell me how format that div? I have a header wrapper for a column heading that sets the width and background of the column header. In that column header I have a tag for the header title, which is aligned left. Know, I find that the customer wants to add an "As of Date", on the same line, but wants it aligned right. Is this even possible to do? I cannot seem to come up with the correct .css code that would allow me to do this. html code Code: <div class="wide_column_header"><span class="headerbartext">Make Your Enrollment Selection</span><span class="headerbartextright">As of 3/31/2008</span></div> css tags: Code: .wide_column_header { float:left; width:558px; margin:0 0 0 5px; background-image:url(../images/wide_header.jpg); height:21px; font-size:100%; font-weight:900; line-height:100%; vertical-align:bottom; color:#fff;} .headerbartext { font-size: 12px; font-weight:bold; text-align:right; padding-left:15px; line-height: 140%;} .headerbartextright { font-size: 12px; font-weight:bold; text-align:right; padding-right:15px; line-height: 140%;} Hi, I have this content Lunch - Chinese Drinks - Soda Dinner - Italian Breakfast - american i want to align these choices So Lunch and drinks, Dinner, breakfast are one below each other and then the - and the corresponding choices Right now it appears likes this Lunch - Chinese Drinks - Soda Dinner - Italian Breakfast - american I want chinese, soda, italian and american all aligned one below each other So i want all the dashes in center and then the content on side of them can someone tell me how i can use css for it charles Hi, How do I place "progress.gif" so that it is in the vertical middle in relation to <input type="text" Right now it is OK in Interent Explorer 6 but appears too high in FireFox. Code: <div> <label>City:</label> <span><input type="text" name="city" /><span><img src="progress.gif" border="0" /></span></span></div> I tried this to no avail. <span style="padding-top:5px"><img src=... Thank you. I have a problem where my image on top there is a little gap below it. This only happens in Internet Explorer and not Mozilla; i wish to rid of that gap. Also I am wondering how would I align the text on the right, i have tried applying the vertical-align: bottom but it does not work. Here is the link: http://www.bluebushel.com/temp/real.html The code is below. MARKUP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en"> <head> <title>Bluebushel | The bushels are alright</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="includes/bluebushel.css" /> </head> <body> <div align="center"> <div id="topBar"> <div class="logo"> <img src="images/testimage.jpg" alt="Bluebushel" /> </div> <div class="nav"> View Bushel | Account | Order Status | Shipping & Returns | Help </div> </div> </body> </html> CSS Code: body { background-color: #E9E9DF; margin: 0em; } a.nav:link, a.nav:visited { color: #000000; font-family: Arial, Verdana; font-size: .8em; text-decoration: none; } a.nav:hover { color: #336699; font-family: Arial, Verdana; font-size: .8em; text-decoration: none; } #topBar { background-color: #FFFFFF; border-left: 2px solid #C5C5C5; border-right: 2px solid #C5C5C5; border-bottom: 1px solid #EEEEEE; height: 5.79em; margin: 0em; padding: 0em; width: 50em; } #topBar .logo { float: left; text-align: left; } #topBar .nav { color: #E3E3E3; float: right; font-family: Arial, Verdana; font-size: .73em; height: 100%; text-align: right; vertical-align: middle; Thank you for your time. here is the page... emarketing and design . com /spa/ Its the "sign up for specials and promotions" with sign up box.. how do I get it to flush right? here is my css--it's "newsletter" (this is my first try with css - be nice) p { margin: 0.4em 0.5em; font-size: 0.85em; } a { color: #197EF1; text-decoration: underline; } a:hover { color: #DF3A00; text-decoration: none; } a img { border: none; } ul, ol { margin: 0.5em 2.5em; } h2 { margin: 0.6em 0 0.4em 0.4em; } h3, h4, h5 { margin: 1em 0 0.4em 0.4em; } * { margin: 0; padding: 0; } body { background: #000000 0 0; color: #a9a9c7; font-size: 1em; font-family: "Trebuchet MS", Tahoma, "Geneva CE", lucida; } #container { margin: 0 auto; width: 770px; position: relative; } #top { height: 50px; background: url("image/top.jpg") 0 0 no-repeat; } #top p { margin: 0; padding: 0; } #header { height: 150px; margin-top: 0px; background: url("image/header1.jpg") 0 0 no-repeat; } #menu { position: absolute; top: 152px; left: 0px; } #newsletter { position: absolute; top: 0px; } #content { clear: both; margin-top: 23px; width: 770px; background: url("image/content.gif") 0 0 repeat-y; } #text { width: 518px; background: #313040 0 0 no-repeat; color: #9c9cd0; float: left; } #column { float: right; width: 247px; background: #414169 url("image/column.gif") 0 0 no-repeat; } #content-bottom { clear: both; display: block; width: 770px; height: 13px; background: url("image/content-bottom.gif") left bottom no-repeat; font-size: 0; } #footer { margin-top: 5px; padding-top: 2px; height: 33px; background: url("image/footer.png") left bottom no-repeat; } #header h1 { margin: 5px 0 0 50px; padding: 0; font-size: 1.2em; } #header h2 { margin: 10px 0 0 90px; padding: 0; font-size: .3em; color: #9c9cd0; } ul#menu { margin: 0; } #menu li { list-style-type: none; float: left; text-align: center; width: 80px; margin-right: 1px; font-size: 1.05em; } #menu a { display: block; height: 18px; padding-top: 1px; text-decoration: none; background: #414169 no-repeat 0 0; overflow: hidden; width: 100%; font-size: .75em; font-family: Verdana, "Geneva CE", lucida, sans-serif; color: #fff; } ul#newsletter { margin: 0; } #newsletter li { list-style-type: none; float: right; text-align: center; width: 290px; margin-right: 0px; font-size: 1.05em; } #newsletter a { display: inherit; height: 18px; padding-top: 1px; text-decoration: none; background: #414169 no-repeat 0 0; overflow: hidden; width: 100%; font-size: .75em; font-family: Verdana, "Geneva CE", lucida, sans-serif; color: #fff; } #menu li>a, #menu li>strong { width: auto; } #menu a.actual { background: url("image/menu-actual.gif") no-repeat 0 0; color: #952020; } #menu a:hover { color: #ff5900; } #column p { font-size: 0.7em; } #column ul { font-size: 0.8em; } #column h2 { position: relative; height: 26px; width: 215px; margin-top: 40px; padding-top: 6px; padding-left: 6px; font-size: 0.7em; background: url("image/h3-column.gif") 0 0 no-repeat; z-index: 1; font-family: arial, "Geneva CE", lucida, sans-serif; } #column h3 { position: relative; height: 5px; width: 215px; margin-top: 4px; padding-top: 2px; padding-left: 6px; font-size: 0.8em; background: url("image/h3-column.gif") 0 0 no-repeat; z-index: 1; font-family: Arial, "Geneva CE", lucida, sans-serif; } #column h3 span { margin-left: 10px; } #column span.name { text-align: right; color: #9c9cd0; margin-right: 5px; } #column a { color: #9c9cd0; } #column a:hover { color: #9c9cd0; } #text h1,#text h2,#text h3,#text h4 { color: #a9a9c7; } #text h3.headlines a { color: #a9a9c7; } p.comments { text-align: right; font-size: 0.8em; font-weight: bold; padding-right: 10px; } #footer p { text-align: center; } #footer a { color: #9c9cd0; } #footer a:hover { color: #DF3A00; } #your-url { position: absolute; left: 70px; top: 15px; font-size: 1.1em; } #your-url a { color:#9c9cd0; text-decoration:none; } #your-url a:hover { color: #9c9cd0; } ol.comments { font-size: 0.9em; } I can usually figure out most CSS problems but this one is a mystery. The following creates a curved box by covering the corner with an image. The problem is in IE6.0, the corner images do not align at the top but display about 10 pixels below it, so therefore I have a the box line and corners at the top and then the curved corners below it. Other browsers display fine, including IE7.0. Why is it doing this? Here is the CSS: Code: <style type="text/css"> .contain { position:relative; top:0; left:0; text-align:left; padding:0; border:1px solid #ccc; margin:0 0 10px 0; background-color:#fff; vertical-align:top; } .corner-top { display:block; font-size:0; line-height:0; margin:0; height:8px; width:100%; position:relative; top:-1px; right:-1px; background:transparent url(/images/crn_tr_bb.gif) no-repeat top right;} .corner-top .corner-left { display:block; font-size:0; line-height:0; margin:0; height:8px; width:8px; position:relative; left:-2px; background:transparent url(/images/crn_tl_bb.gif) no-repeat top left; } .corner-bottom { display:block; font-size:0; line-height:0; margin:0; height:8px; width:100%; position:relative; bottom:-1px; right:-1px; background: transparent url(/images/crn_br_bb.gif) no-repeat bottom right;} .corner-bottom .corner-left { display:block; font-size:0; line-height:0; margin:0; height:8px; width:8px; position:relative; left:-2px; background: transparent url(/images/crn_bl_bb.gif) no-repeat bottom left; } </style> <div class="contain"> <div class="corner-top"><div class="corner-left"></div></div> <div class="intro" style="position:relative;"><p>Text here...</p> <div class="corner-bottom"><div class="corner-left"></div></div> </div> Hi, I know this must be a real stupid question but I've tried loads of googling around and just cant figure out how to do this. Please could someone tell me what I'm doing wrong. I want the <a> to be aligned to the top right. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> body { font: 12px Verdana, sans-serif; } .assignment { margin: 2px; padding: 4px; border: 1px solid; border-color: gray; background-color: lightyellow; text-align: left; width: 150px; height: 20px; vertical-align: center; } a.removeAssignment { align: top; padding: 1px; margin: 0px; border: 1px solid gray; position: relative; top: 0px; right: 0px; float: right; width: 16px; height: 16px; background-image: url('remove_icon.png'); background-repeat:no-repeat; background-position: center; } </style> </head> <body> <div class="assignment">Hello<a href="#" class="removeAssignment" /></div> </body> </html> Hey i'm new to this forum thing so here goes. I'm stuck trying to align an image in the center of an e-mail template. I'm using inline CSS to keep the template as small as possible. The code i have is: <img src="yes_group.jpg" alt="Yes Company Logo" height="100" width="50%" /> I need something i can put into that line of code to center the image. I've searched a few different site for hints (or the actual tag i need) but can't seem to find it anywhere. Any help would be greatly received so if you have any idea's please let me know. Thank You. Hi all - can anyone tell me why the table in the first <li> will not / is not aligning with the top? It seems to be starting at line 2 within the <li> and I can't figure out why!?!?!?? Code: <ol style="border: 1px solid green;"> <li> <table cellpadding="0" cellspacing="0" border="1" style="width: 100%; border: 1px solid red; height: 10px;"> <tr> <td style="width: 70%;"> </td> <td style="width: 30%;"> </td> </tr> </table> </li> <li>Second row of text.</li> <li>Third row of text.</li> </ol> regan Basically on my main page the left menu and right content divs don't align, i need the rights bit to align with the lefts lower bit. linky -> http://www.gamingonlinux.info/ css that controls them: Code: .left { float: left; width: 152px; } .left_bg { background-image: url(images/left.gif); background-repeat: no-repeat; } .left_bg p { padding-top: 9px; padding-left: 6px; line-height: 150%; } .right { float: right; background-image: url(images/content.gif); background-repeat: no-repeat; width: 748px; } .right p { padding-left: 5px; } I've tried the usual trick of setting the width and margin-left and right to auto but it just doesnt work. If someone could please help with this, that would be great. This is all the code in my css file as of now, i'm using an img tag as my bacground incase people were wondering, so that it would resize to fit the window. the #content block is the one that i'm referring to. css Code: Original - css Code body { font-family: Verdana, Tahoma, Arial; color: #FFFFFF; text-align: center; margin-left: auto; margin-right: auto; } .bg { width: 100%; position: absolute; top: 0; left: 0; z-index: 5000; } #content { width: 800px; height: 600px; top: 0px; left: 0px; position: absolute; z-index: 6000; border: 1px solid #FFFFFF; margin-left: auto; margin-right: auto; } .nav { background-image: url('images/blank.jpg'); background-repeat: no-repeat; } a:link { text-decoration: none; color: #0066CC; font-size: 9px; } a:hover { text-decoration: underline; color: #0066CC; font-size: 9px; } a:visited { text-decoration: none; color: #0066CC; font-size: 9px; } a:active { text-decoration: none; color: #0066CC; font-size: 9px; } body { Hi guys. I was trying hard to figure out myself before posting this question on this site: (www dot paintersdirectory.ie/listing/location/leinster/county-longford) there is a "float-right" div ".sidebarSearch". It is hitting left bottom corner of the div "map" above it. I would like my sidebarSearch to be underneath map on the very right. Thank you very much Hi I want to know if it is possible to vertical align the text in these div tags and how it's done. 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> <style type="text/css" media="all"> #1 {width:15%} #2 {width:20%} #3 {width:25%} #4 {width:20%} #5 {width:20%} #1,#2,#3,#4,#5 { float:left; overflow:hidden; display:inline-block; height:128px; text-align:center; } </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <div id="1"><a href="#"><img name="" src="" width="100" height="125" alt="" /></a></div> <div id="2"><a href="#">fffffffffffggfgf fg gd</a></div> <div id="3"><a href="#"> dfg dfg dg d</a></div> <div id="4"><a href="#"> dgd gd d</a></div> <div id="5"><a href="#"> gdf gdg ddg</a></div> </body> </html> Greets, dabomb_gent Hello to all of you, I am doing my first steps in respect to CSS programming and wonder if I can get some hint here. I have created a table, with two different line colors, and a changing line background color with hover. Basically everything works as expected - just the vertical-align command does not respond at all. Am I doing something wrong? What could be the reason, and how can I continue investigating? I am using the CSS stylesheet, in connection with a Joomla 1.5 CMS. Please see the code below: Code: table.general { text-align: left; vertical-align: top; width: 100%; border-collapse: collapse; } table.general th { text-align: center; font-size: 15px; color: white; font-style:bold; height: 30px; background-color:#95B3D7; border: 3px solid #FFFFFF; } table.general tr.row1 { background-color: #f1f1f1; } table.general tr.row2 { background-color: #e0e0e0; } table.general tr.row1:hover { background-color: #CCCCCC; } table.general tr.row2:hover { background-color: #CCCCCC; } table.general td { border: 3px solid #FFFFFF; padding: 4px; } The classes are being used in the following form: Code: <table style="width: 320px;" class="general"> <col span="4" width="80"></col> <tbody> <tr> <th>head A</th> <th>head B</th> <th>head C</th> <th>Alface</th> </tr> <tr class="row1"> <td>Topic A</td> <td>65</td> <td>215</td> <td>35</td> </tr> <tr class="row2"> <td>Topic B</td> <td>2</td> <td>2,3</td> <td>1,2</td> </tr> <tr class="row1"> <td>Topic C</td> <td>68</td> <td>55</td> <td>13</td> </tr> <tr class="row2"> <td>Topic D</td> <td>44</td> <td>50</td> <td>33</td> </tr> <tr class="row1"> <td>etc.</td> <td>494</td> <td>611</td> <td>238</td> </tr> </tbody> </table> Thank you in advance for your kindness! for example if there is a container div which holds an inner div, if i want the content of the inner div to appear exactly at the bottom edge of the inner div i have used the following code, #outer{ position: relative; float: left; width: 900px; height: 200px; } #outer .inner{ position: relative; float: left; width: 500px; height: 200px; vertical-align: bottom; } however the content of the inner div is starting at its default location which is top left of the inner div instead of using margin-top or padding-top, or positioning methods for the inner div to position the content at the bottom edge can the vertical-align: bottom; be used as this will be very accurate placed at the bottom edge even if the content increases the content will always appear at the bottom edge, unlike other methods where the margin-top, padding-top, and positioning, these values will have to be changed whenever content increases or decreases. please advice. thanks. Hi! I want to align my container div 120px to the left from the center, what css code should I use for that? You can see the homepage at madeleinegaterud dot com/test 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. |