CSS - Getting Images Flush Vertically
Not strictly css but css may be the solution :-)
I have created a sample page where you can see the problem: http://www.virtual-league.com/demo/ I want the images to sit flush above one another. If I take the text out of any of the lines then the images on those lines will join up nicely. Any ideas? Similar TutorialsOK, I have three images: a top, middle, and bottom that need to align vertically. It should look like a typewriter with paper coming out when said and done. You can see what's wrong at csshore(dot)com Here is the css: #top { background:url(images/top.gif) no-repeat; background-position:50%; width: 617px; float:none; margin:0 auto; height: 55px; position: relative; } #container { background:url(images/middle.gif) repeat-y; background-position:center; width: 601px; padding:0; margin:0 auto; height: 100%; position: relative; min-height:600px; } #bottom { background:url(images/bottom.gif) no-repeat; background-position:50%; width: 800px; height:485px; margin:0 auto; position: relative; } .center { background-image:url(images/wood014.jpg); } And the html: <div id="top" class="center"></div> <div id="container" class="center">When in the course of human events, it becomes necessary for a people to through off the reigns of governement and create a new one. </div> <div id="bottom" class="center"></div> Ignore the failed attempt to quote the Declaration of Independence. I have tried everything I know (which admittedly is little) and I can't get them to align. Thanks in advance. I have a div with blue background on the page below. It is is currently displaying horitzontally across the screen, with the images inside doing the same. I would like to vertically align it along the right side of the page, next to the text (which would be on the left). I'd also like the 'Property Search' within the blue, aligned below the photo of the house. Can anyone help me out? I'd like to KNOW how to do it and not have someone just send me an updated style sheet. Thanks. Styles attached. http://mulqueenconsulting.com/galese/ I'm trying to tile a background image horizontally with a vertically tiled background image centered on the page. Being new to css and not particularly fluent in html (although more so than css), I have no idea how to go about doing this or if it is even possible. I do have both images working separately though. Help would be appreciated. -alexa HI guys I'm basically ultra confused as to why a particular div in my layout won't line up on the following page.. http://hcl.uk.com/test/instaffs/enews1/ I'm talking about the orange box on the right hand side. As you can see, in Firefox it sits right against the line above it, yet in IE 6 theres a 4 or 5 pixel gap forcing the box down. I have been through both my CSS and markup and still can't figure out why this happening.. the only thing I can think of is that it's an IE bug that I don't know about. If anyone can take a look and give me some pointers on what it might or could be that would be great. Thanks in advance for all your help. Stu Hi Um basically I have 2 divs inside in another main layout div, and basically i cant get them to sit to there is no space between them in IE, in firefox its fine. if you go here and open it in firefox then IE you'll see what i mean, any ideas? Html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html> <head> <title>lost layout test</title> <link rel="stylesheet" type="text/css" href="layout.css" /> </head> <body> <div id="outerBox"> <div id="topBox"> <div id="leftTop">left part1</div> <div id="rightTop">right part1</div> </div> </div> </body> </html> CSS: (not all is used in this example) Code: body { background: url("images/grad_bg.jpg"); background-color: #d53e3e; background-repeat: repeat-x; text-align: center; } #outerBox { width: 700px; height: 800px; margin-left: auto; margin-right: auto; background-color: purple; padding: 0px; margin-top: 0px; border: 0px; } #topBox { width: 700px; height: 200px; color: white; text-align: left; padding: 0px; margin: 0px; background-color: green; border: 0px; } #leftTop { width: 500px; height: 200px; background-color: pink; padding: 0px; margin: 0px; float:left; border: 0px; } #rightTop { height: 200px; margin-left: 500px; background-color: orange; padding: 0px; border: 0px; } #bodyBox { width: 700px; height: 540px; color: red; background-color: blue; float:left; text-align:left; } #leftContent { width: 500px; height: 540px; background-color: blue; } #rightContent { width: 200px; height: 540px; background-color: grey; float:right; } #footBox { height: 60px; width: 700px; color: red; text-align: left; background-color: black; float:right; } Hello.This should be simple enough. I have an image on my page(image1.bmp),immediatly folowed by a table(class=table1). The thing is I want the image to be flush with the top of the table with no gap,but there is a small gap,How can I fix this? Thanks note(I left a //here mark on the html page where the problem is. css sheet: Code: #menu { clear: both; margin: 30px; padding: 0; background: url(menu.jpg) repeat-y center top; font: 12px/26px Courier New; height: 26px; background: #006633; text-align: center; } #menu ul { float: none; list-style: none; margin-top:0; padding: 0; margin-right:0; padding: 0; margin-bottom:0; padding: 0; margin-left:90; padding: 0; } #menu ul li { display: inline; } #menu ul li a { display: inline; float: 0 auto; padding-top: 8px; padding-right: 28px; padding-bottom: 8px; padding-left:8px; color: gold; text-decoration: none; } #menu ul li a:hover { background-color:003300; color: gold; } #menu ul li#current a { background-color: #eee; color: #333; } a { color: black;font-size: 10pt; text-decoration: none; border-bottom-style: solid; border-bottom-width: 0px } a:link { border-bottom-color: navyblue } a:visited { border-bottom-color: purple } a:hover { border-bottom-color: green } a:active { border-bottom-color: red } H1.texter { font-family: 'Lucida Console'; font-size: 15pt; color: #black; font-variant: normal; text-decoration: none; } H1.texter2 { font-size: 14px; color: #black; font-family: 'Lucida Console'; font-variant:normal; FONT-WEIGHT: normal; } H1.texter3 { font-family: 'Lucida Console'; font-size: 10pt; FONT-WEIGHT: normal; color: navyblue; text-decoration: none; } TABLE.Table1 { height: 150px; width: 380px; top-border-style:hidden; border-top:hidden; border-bottom:solid; border-left:solid; border-right:solid; border-color: #000000; background-color:white; border-width: 1px; margin: 0px; padding: 0px ; } TABLE.Table2 { margin: 0px; padding: 0px; height: 199px; width: 430px; background-color:limegreen; } html sheet: Code: <html> <head> <title>Keep track and review golf scores</title> <meta name="description" content="Keep track of and review golf scores"/> <meta name="keywords" content="Golf","records","review","tabulation"/> <meta name="robots" content="index" /> <link rel="stylesheet" type="text/css" href="style.css" title="BlueSky 3.0 CSS"></head><body> <style> body { background-color: limegreen; <font FACE="Lucida Console"> } H1.texter1 { font-family: 'H1.texter2 { font-family: 'Lucida Sans Unicode'; font-size: 75pt; color: black; FONT-WEIGHT: normal; font-variant:Not Set; } </style> </head> <body> <div id="menu"> <ul align="center"> <li><a href="golfgame/Users/register.php">Join</a></li> <li><a href="golfgame/Users/Log_in.php">Login</a></li> <li><a href="golfgame/Users/help/tour.html" >Tour</a></li> <li><a href="golfgame/Users/contact.php">Contact</a></li> </ul> </div> <br> <IMG SRC="green4.bmp" align="left"> <IMG SRC="green4.bmp" align="right"> <br> <center> <table width=300><tr><td align='left'><IMG SRC="golf.bmp"> </td ><td align='center'> <IMG SRC="golf.bmp"> </td><td align='right'> <IMG SRC="golf.bmp"> </td></tr></table> </center> <br><br><center> <IMG SRC="logo.bmp" align="center"> </center> <br><center> <IMG SRC="image1.bmp"> //here <table class=table1> <tr><td align='left'><br> <h1 class=texter2><li>content here scores!</li></h1></td></tr> <tr><td><h1 class=texter2> <li>content here</li></h1> </td></tr> <tr><td><h1 class=texter2> <li>content here</li></h1> </td></tr> <tr><td><h1 class=texter2> <li>content here</li></h1> </td></tr> </table> </center> </body></html> Hi, This might be a case of an easy fix thats being over-looked but I've tried everything I haven't been able to find to 'fix' this. FF is cool, IE is giving me 'teh gap' I have attached an image, I highlighted the pic so it shows the black bar of space right under the top image. There are two DIVs that are 'stacked' The top one has the top half of the image, the bottom one has the gold bar as a background image, with the bottom half of the pic in it. I can't make the images the background of the div because i'm adding a rollover and link to the images. So, CSS: Code: #interior_top_image{ text-align:center; vertical-align:bottom; display:block; height:85px; margin:0px; padding:0px; } #interior_header{ background-image:url("images/interior_bottom.jpg"); background-position:bottom center; background-repeat:no-repeat; background-color:#263F7F; display:block; height:85px; text-align:center; margin:0px; padding:0px; } HTML: Code: <div id="interior_top_image"><img src="images/cross_top.jpg" name="cross_top" border="0"></div> <div id="interior_header"><img src="images/cross_bottom.jpg" name="cross_bottom" border="0"></div> Good day, I'm hoping to have this content right up against the top of the browser window. I've played around with padding values, but they don't seem to do anything and I'm unsure of what to try next. Any advice appreciated. Code: #sectionHeader { width: 800px; margin-top: 0px; margin-left: auto; margin-right: auto; } Code: <body> <div id="sectionHeader"> <img src="images/header.jpg" alt="Welecome to Doctor Martin's Site" width="800" height="321" border="1" /> </div> </body> I want to center my site, which I have found I can do by giving an absolute position to the main content area - but I also want to repeat an image in the background behind the main content, and I cannot do the both and prevent some empty white space at the top of the page. Can you help? (I am new at this.) What am I doing wrong? So, to recap: I want a centered site, an image behind the main content area, and no empty white space in the browser above my bg image. I am currently using IE (7). TIA. #body { margin: 0px; padding: 0px 10px 0px 10px; width: 100%; background: #ff9900 url('bg_repeat.jpg') repeat-x; } #container { top: 0px; left: 0px; padding: 0px 10px 10px 10px; margin: 0 auto; --> this will center my site, but I still cannot see the bg image stated in the body div border-right: #ffff99 solid 1px; border-left: #ffff00 solid 1px; background: #fff; width: 75%; } I would like to align left images so that they touch against each other. Here is a capture of my problem. dollhedz.com/test [CODE] <style type="text/css"> body{ background-color:#000033; color:#00cc33; } #wrapper{ background-color:#000000; margin:15px auto 0px; width:700px; height:800px; } #sitenav{ background-image:url(sitegrax/sitenavback.jpg); background-repeat: no-repeat; height:55px; padding-left:213px; border: 0px; margin:0px; text-align:left; } #one{ float:left; text-align:left; align:left; margin:0px; padding:0px; } </style> </head> <body> <div id="wrapper"> <div id="banner"><img src="sitegrax/banner.jpg" alt=" yellow Jacket dodging a 355 smoothbore slug" border="0" /> </div> <div id="sitenav" > <div id="one"><a href=""><img src="sitegrax/bt_game_nav.jpg" alt="site navigation games" border="1" /></a> <a href="" align="left"><img src="sitegrax/bt_history_nav.jpg" alt="site navigation history" border="1" /></a> <a href=""><img src="sitegrax/bt_pilot_nav.jpg" alt="site navigation pilot"border="1" /></a></div> </div> </div> </body> </code> Problem: There is a 5 to 6 pixel space between each image that I would like gone. The 1px border around each image is there to show the edge of each image. thank you for your time I am aware of how difficult it is to vertically align text etc using pure css but what is hte best way to do it. For example i want to put some text slap bang into the middle of the screen. Thanks I started out working out a page thinking this *should* do what I want and lo and behold it did work in IE6 http://www.fogcat.co.uk/example/test002.html But when looking at Firefox it goes all odd. If you remove all the internal "imagediv" div from the "imagechunk" div it nearly works but doesn't algin the "link text" like IE. I'm told that display:inline-block is not properly supported, which is probably the root of my problems. What I want a set of divs down the page (the "imagedivs") Each div will contain An image - but that image will be nested inside a div - it's returned that way from a php function. Images may be of varying height so I can't use pixel values at top margins or anything like that. A link to another page The link should be positioned to the right of the image and aligned vertically with the centre of the image. This is one of those things that's a doddle with tables, but I'm trying to train myself to think CSS. What obvious thing am I over looking? Code: +--------------------------------------+ | +----------------+ | | | .............. | | --- <div> | | : : | | ... <img> | | : : | Link here | | | : : | | | | .............. | | | +----------------+ | +--------------------------------------+ +--------------------------------------+ | +----------------+ | | | .............. | | | | : : | | | | : : | Link here | | | : : | | | | .............. | | | +----------------+ | +--------------------------------------+ Hello, how do you align vertically a radiobutton with label without using the <br> tag in css? Code: <fieldset> <legend>Food</legend> <input name="Password" type="radio" id="p" value="" checked="checked" /> <label>HTML</label> <br /> <input name="n1" type="radio" id="p" value="" /> <label>ASP</label> <br /> <input name="n1" type="radio" id="p" value="" /> <label>Donut</label> <br /> <input name="n1" type="radio" id="p" /> </fieldset> Hey everyone, my first time exploring page layouts using CSS and I'm having a few problems. I have a simple page with separate Header, Navigation and Content divs stacked on top of each other inside of a wrapper div (used to align the three to the center), with another div for the Footer placed below everything else. Here's how it looks now: Code: <html> <head> <title>CSS Divisions</title> <style type="text/css"> #Wrapper { width:800px; margin-left:auto; margin-right:auto; text-align:left; } #Header { width:800px; height:120px; background:#FC6;} #PNav { width:800px; height:40px; float:left; background:#CCC; } #Content { width:800px; height:400px; float:left; overflow:hidden; background:#FFC; } #Footer { width:100%; height:80px; float:left; text-align:center; background-color:#FC6; } </style> </head> <body> <div id="Wrapper"> <div id="Header">Header</div> <div id="PNav">Navigation</div> <div id="Content">Content</div> </div> <div id="Footer">Footer</div> </body> </html> Ideally what I want is for the page to look exactly how it is, but with the footer stretching from the bottom of the Content div, down to the bottom of the wherever the user's browser has loaded; basically to fill the vertical remainder of the screen. I've tried setting the footer height to 100%, but that forces the page to extend vertically, and I fumbled around with about a dozen other techniques not really knowing what I was doing, and I've had no luck so far. Any help would be greatly appreciated! i'm trying to vertically align a div box (the sign in area) so that it sits on top of this grey (soon to be) navigation bar...i've floated the box to the right...i want it to align to the bottom now...can anyone help me? ------> http:// www . u2station . com / index2.php and the stylesheet is at: http:// www . u2station . com /movabletype/mt-static/support/themes/u2station/u2station.css i've basically been trying to radically modify an existing theme that movable type (MT) publishing system created so i can alter it to my specs. any quick help with this simple css adjustment would be extremely helpful...(otherwise i'm thinking of reverting back to old fashioned tables as a last resort). I have a navigation bar that contains four images (side by side) as well as three text links. They all live within a <div> with the following properties: #gNav { width:768px; height:19px; text-align:left; vertical-align:middle; } i need for the three text links to line up directly in the middle (vertically) of that <div>. To achieve this in IE6 and NN+, I attach the following style to the text. .nookum { font-size:.9em; vertical-align: 25%; color:#FFFFFF; } I just learned that the vertical-align property is not recognized by IE5 and IE5.5, so in those versions, the text aligns at the bottom of the <div>. Anyone know of any workarounds or other methods of vertically aligning text that will work in these two versions of IE? hi i would like to display some pictures on my site, and be able to scroll horizontally, i have simply listed the pictures in the xhtml and my css cose is below. at the moment the pictures still stack up vertically so the horizontal scroll bar cannot be used. can anyone help? thanks div.galleryscroll { height: 125px; width: 694px; position: absolute; top: 540px; left: 280px; z-index: +1; overflow-y: hidden; overflow-x: scroll; } How would I center an image vertically in a div that has varying height? Normally I would set a line-height and then a vertical-align but the container is of varying size dependent on content . The only way I can think of is to make the image a background and do background-position: center center; Is that the only workaround? is it possible to center something vertically inside a container without the use of tables? I know you use text-align to center horizontally, but what is used for vertical alignment? vertical-align doesn't work. PHP Code: <div style="width:100% height:100%; text-align:center;"> <!-- code goes here --> </div> thanks goran. If you go to the page http://electrojams.com/2010/05/03/n...le-some-chords/ you will see at the top of my post the "social sharing" icons... They are all embedded JavaScripts, but how can I align them? The Stumbleupon button is lower than the others... |