CSS - Pic At Absolute Bottom & Text ?
I've read the threads about making text and background colors appear at the bottom of a page.
What I'd like to do is force an IMAGE to the page bottom, and on top of THAT, include a phone number, and active email link. Is this doable ? I've tried so many ways. The image always works, but while the text and email are OK in an 800x600 res, they jot up for a 1024x768. Anyone have experience with this ? Similar TutorialsI am trying to make a layout with a background image with 3 content boxes layered on top of it. The first two boxes are position correctly. They are offset top, left and top, right respectively. The third box should be positioned bottom, left but for some reason it isn't working. The left offset is working correctly, but instead of positioning itself off of the bottom of the container div, it positions itself that much above the viewport. If I set the bottom property to negative something, it acts like a top offset. While this is a workaround, it does not provide acceptable functionality. Anyone have any ideas? I've had two friends who are both seasoned web developers look at this and they were both stumped. I can post images of what it looks like and what it should look like if desired. Both of these code sections are php generating the html and css respectively. html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title><?=$title?></title> <link rel="stylesheet" type="text/css" href="./themes/<?=$theme?>/css/main.php" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#bottom_ccw").attr({ scrollTop: $("#bottom_ccw").attr("scrollHeight") }); }); </script> </head> <body> <div id="wrapper"> <div id="inner_wrapper"> <div id="background"></div> <div id="left_bw"> <div class="top_b"> <div class="border_tl"></div> <div id="l_border_t"></div> <div class="border_tr"></div> </div> <div> <div id="l_border_l"></div> <div id="l_border_r"></div> </div> <div class="bot_b"> <div class="border_bl"></div> <div id="l_border_b"></div> <div class="border_br"></div> </div> </div> <div id="left_ccw"> <div id="cc1"> <?for($i=0;$i<500;$i++):?>1 <?endfor;?> </div> </div> <div id="right_bw"> <div class="top_b"> <div class="border_tl"></div> <div id="r_border_t"></div> <div class="border_tr"></div> </div> <div> <div id="r_border_l"></div> <div id="r_border_r"></div> </div> <div class="bot_b"> <div class="border_bl"></div> <div id="r_border_b"></div> <div class="border_br"></div> </div> </div> <div id="right_ccw"> <div id="cc2"> <?for($i=0;$i<1200;$i++):?>2 <?endfor;?> </div> </div> <div id="bottom_bw"> <div class="top_b"> <div class="border_tl"></div> <div id="b_border_t"></div> <div class="border_tr"></div> </div> <div> <div id="b_border_l"></div> <div id="b_border_r"></div> </div> <div class="bot_b"> <div class="border_bl"></div> <div id="b_border_b"></div> <div class="border_br"></div> </div> </div> <div id="bottom_ccw"> <div id="cc3"> <?for($i=0;$i<200;$i++):?>3 <?endfor;?> </div> </div> </div> </div> </body> </html> css: css Code: Original - css Code <? header("Content-type: text/css"); ?> <? //Left content box width. $lcbw = 300; //Left content box height. $lcbh = 443; //Left content box horizontal offset. $lcbho = 100; //Left content box vertical offset. $lcbvo = 55; //Right content box width. $rcbw = 550; //Right content box height. $rcbh = 550; //Right content box horizontal offset. $rcbho = 100; //Right content box vertical offset. $rcbvo = 55; //Bottom content box width. $bcbw = 300; //Bottom content box height. $bcbh = 100; //Bottom content box horizontal offset. $bcbho = 100; //Bottom content box vertical offset. $bcbvo = 0; ?> /* Equalize the padding and margin for all elements across all browsers. */ * { padding: 0px; margin: 0px; } /* Generic top section for a content box. */ .top_b { clear: right; } /* Generic bottom section for a content box. */ .bot_b { clear: left; } /* Top left corner of a border. */ .border_tl { float: left; background: url('../images/main/border_tl.png'); width: 26px; height: 25px; } /* Top right corner of a border. */ .border_tr { float: left; background: url('../images/main/border_tr.png'); width: 26px; height: 25px; } /* Bottom left corner of a border. */ .border_bl { float: left; background: url('../images/main/border_bl.png'); width: 26px; height: 25px; } /* Bottom right corner of a border. */ .border_br { float: left; background: url('../images/main/border_br.png'); width: 26px; height: 25px; } /* Main site wrapper. */ #wrapper { margin: auto; width: 1057px; padding-top: 5px; } /* Main site inner wrapper. */ #inner_wrapper { position: relative; } /* The background element. */ #background { background: url('../images/main/background.png'); width: 1057px; height: 679px; position: absolute; z-index: 1; } /* Left content box borders wrapper. */ #left_bw { position: absolute; z-index: 2; top: <?=$lcbvo?>px; left: <?=$lcbho?>px; width: <?=$lcbw?>px; height: <?=$lcbh?>px; } /* Left content box top border. */ #l_border_t { float: left; background: url('../images/main/border_top.png'); width: <?=($lcbw-52)?>px; height: 14px; } /* Left content box left border. */ #l_border_l { float: left; background: url('../images/main/border_left.png'); width: 14px; height: <?=($lcbh-50)?>px; } /* Left content box right border. */ #l_border_r { float: right; background: url('../images/main/border_right.png'); width: 14px; height: <?=($lcbh-50)?>px; } /* Left content box bottom border. */ #l_border_b { margin-top: 11px; float: left; background: url('../images/main/border_bottom.png'); width: <?=($lcbw-52)?>px; height: 14px; } /* Left content container wrapper. */ #left_ccw { position: absolute; z-index: 3; top: <?=($lcbvo+14)?>px; left: <?=($lcbho+14)?>px; width: <?=($lcbw-28)?>px; height: <?=($lcbh-28)?>px; overflow: hidden; } /* Left content container. */ #cc1 { padding: 5px; } /* Right content box borders wrapper. */ #right_bw { position: absolute; z-index: 2; top: <?=$rcbvo?>px; right: <?=$rcbho?>px; width: <?=$rcbw?>px; height: <?=$rcbh?>px; } /* Right content box top border. */ #r_border_t { float: left; background: url('../images/main/border_top.png'); width: <?=($rcbw-52)?>px; height: 14px; } /* Right content box left border. */ #r_border_l { float: left; background: url('../images/main/border_left.png'); width: 14px; height: <?=($rcbh-50)?>px; } /* Right content box right border. */ #r_border_r { float: right; background: url('../images/main/border_right.png'); width: 14px; height: <?=($rcbh-50)?>px; } /* Right content box bottom border. */ #r_border_b { margin-top: 11px; float: left; background: url('../images/main/border_bottom.png'); width: <?=($rcbw-52)?>px; height: 14px; } /* Right content container wrapper. */ #right_ccw { position: absolute; z-index: 3; top: <?=($rcbvo+14)?>px; right: <?=($rcbho+14)?>px; width: <?=($rcbw-28)?>px; height: <?=($rcbh-28)?>px; overflow: hidden; } /* Right content container. */ #cc2 { padding: 5px; } /* Bottom content box borders wrapper. */ #bottom_bw { position: absolute; z-index: 2; bottom: <?=$bcbvo?>px; left: <?=$bcbho?>px; width: <?=$bcbw?>px; height: <?=$bcbh?>px; } /* Bottom content box top border. */ #b_border_t { float: left; background: url('../images/main/border_top.png'); width: <?=($bcbw-52)?>px; height: 14px; } /* Bottom content box left border. */ #b_border_l { float: left; background: url('../images/main/border_left.png'); width: 14px; height: <?=($bcbh-50)?>px; } /* Bottom content box right border. */ #b_border_r { float: right; background: url('../images/main/border_right.png'); width: 14px; height: <?=($bcbh-50)?>px; } /* Bottom content box bottom border. */ #b_border_b { margin-top: 11px; float: left; background: url('../images/main/border_bottom.png'); width: <?=($bcbw-52)?>px; height: 14px; } /* Bottom content container wrapper. */ #bottom_ccw { position: absolute; z-index: 3; bottom: <?=($bcbvo+14)?>px; left: <?=($bcbho+14)?>px; width: <?=($bcbw-28)?>px; height: <?=($bcbh-28)?>px; overflow-x: hidden; overflow-y: scroll; } /* Bottom content container. */ #cc3 { padding: 5px; }
Sorry I tried to get the HTML to highlight too but it wouldn't work. Screenshot of how it looks: http://i34.photobucket.com/albums/d105/alphasynaptic/wrong.jpg Screenshot of how it should look (done with my hacky workaround): http://i34.photobucket.com/albums/d105/alphasynaptic/right.jpg i have a div tag absolutely positioned and inside that tag i ONLY have an image. so if place it in some code like this: Code: <tr><td><div id="thetag"><img src="asdf.gif" width="10" height="20"></div></td></tr> and following that right away, if i have another table row with whatever in it: Code: <tr><td>asdf</td></tr> then what happens is that second row gets shifted up and gets put in place under the first row, making the image overlap the 'asdf'. if i put at least one char after the image in the div, its fine and the second row will follow under the image on a new line like it should, but i dont want any text in there. any ideas? thanks I have a chess website at www.nothingbutchess.com. I'm having issues with the page showing up properly with IE7. On the left hand side, you'll see a box with the heading "Nothing But Chess - News". On the right, you'll see a box with the heading "Recent Checkmates". Both of these headings are divs that have png images for the background and the wording inside of them. The problem is, in IE 7 those words are being cut off. Specifically, although the div and the image used for the background of that div are 26 px tall, the words within the div seem to be getting cut off at the 19 px mark. I used a ruler to measure. The css that, for example, that controls the "recent checkmates" header can be found at www.nothingbutchess.com/css/nbc.css and is... Code: .recent_checkmates_top { position:relative; background: url(/images/home_wins_top.png) no-repeat top left; background-color:#FF6633; height:26px; } The actual html is nothing special and is simply Code: <div id="recent_checkmates"> <div class="recent_checkmates_top"> <h1>Recent Checkmates</h1> </div> ..... If anybody has an idea why this is happening, I'd be eternally grateful. Thanks in advance. I have a web site using XHTML 1.0 Strict. The main body of the web pages is absolutely positioned 225px from the left, 100px from the top and is 750px wide. There is a banner and menu at the top and then another menu with links to the left. They are also absolutely positioned as well. I am using IE 6.0 as the main web browser since this is a corporate environment. The problem that I am having is that when I select text in the main body it either selects everything from the top down to the cursor or from the cursor to the end. I have troubleshot this and narrowed it down to the absolute positioning. It works fine in IE 7 with the absolute positioning. Does anyone know why this is happening and is there a work around for this? Thank you. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Code: #content { position:absolute; width: 750px; left: 225px; top: 100px; z-index: 500; border-top-style: outset; border-right-style: outset; border-bottom-style: outset; border-left-style: outset; background-color: #ECE9E2; } I have two images at the top of a paragraph, one floating left, the other, right. I would like the right floater to go to the *bottom* of the graph. Below is a truncated version of the graph and the CSS style sheet I created, trying, unsuccessfully, to bottom the image. (The image remains at the top.) I validated my current document (which doesn't have this floatrightbottom in place yet.) The document validated as CSS level 2.1 ! <p><img class="floatleft" src="FreddieWAud110x130.jpg" width="110" height="130"><img class="floatrightbottom" src="SherpWithAward113x109.jpg" width="113" height="109" style="vertical-align=-25px">In 1990, FG conceived Movies Junior introducing movie theatre ... (Toni Honors are given annually for theater accomplishments not eligible in established Toni Award categories.)</p> .floatrightbottom { float: right; margin-top: 6px; margin-right: 0px; margin-bottom: 6px; margin-left: 15px; padding: 2px; border: 4px solid #666; vertical-align: text-bottom; } How do you get the text to bottom of a blank page regardless of the browsers size? valign only works for the position of a single row and margin does not work very well as if the browser is to small it will not display and if to large it will appear to high. I am wanting to use this on an intro type of page. Also is there a way to display a new html page containing text from a frame link with a transparent background so as to keep the prior background "fixed" in view with the text on top of that? hey all, here's my test page http://www.pyesnflpool.com/ at the top... Im trying to get the two links (Register & Recover Your Password) to be beside the arrows and Email Pye beside the mail image it is running off two scripts, one for the links (snippetSideLine)and the other is holding together the header (elementTopPage) As you can see on side-b I was making some effort to align them to the bottom with no success, my thoughts were to align to the bottom and than do a padding-bottom: 15px; or whatever, because I tried padding-top:120px to side-a which put the links in the right spot but left the rest of the page all over the place any help is much appreciated, thanks Code: <!-- snippetSideLine --> <div> <?php if (isset ($this->User) && !empty ($this->User)) { if ($this->User->Type == 1) { ?> <a href="../admin/index.php">Admin Panel</a> <?php } ?> <a href="../members/myaccount.php">My Account</a> <a href="index.php?Logout">Logout</a> <?php } else { ?> <a href="../members/register.php">Register</a> <a href="../members/forgotten.php">Recover Your Password</a> <?php } ?> </div> <!-- End: snippetSideLine --> Code: <!-- start: elementTopPage --> <style type="text/css"> #wrapper { text-align: left; vertical-align: text-bottom; margin: 0px auto; padding: 0px; border:0; width: 850px; } #side-a { float: left; width: 458px; height: 167px; background: url('../images/top_left.jpg') no-repeat; } #side-b { float: right; width: 168px; height: 167px; vertical-align: text-bottom; vertical-align: baseline; background: url('../images/top_right.jpg') no-repeat; } #content { float: left; width: 224px; height: 167px; background: url("../images/top_bg.jpg") repeat; } </style> <!-- elementTopPage --> </head> <body> <div id="wrapper"> <div id="container"> <div id="side-a"> <?php $this->Snippet ('SideLine'); ?> </div> <div id="content"> </div> <div id="side-b"> email pye </div> </div> </div> <!-- End: elementTopPage --> I'd like to have a container, a row, really. And I'd like text aligned to the top of the div, and then some more text aligned to the bottom of the div, like this: ------------------------------------------ Top text Bottom text ------------------------------------------ The thing is, I can't use tables, so if someone knows how to accomplish in a completely tableless way, I'd appreciate it! I did try the following, but it didn't work: Code: .mainDiv{ position: relative; float: left; width: 150px; } .mainDiv .upper { top: 0; position: absolute; } .mainDiv .lower { bottom: 0; position: absolute; } I seem to have messed up while slicing...If my font size is too large, it'll mess up my table positioning...I'd like to know if there's any way to align text to the bottom of a table collumn? Is there anything I can put in my style sheet to do this? Am I not being clear enough? Please help. EDIT : I've got a picture uploaded. See how on the left there's that white space? And under "Welcome" there's also a lot of space? I figure if I could align the text to the bottom, it'd fix both problems. =/ so I have a side menu & main content inside a main container which has background so it looks like side menu & main content have diff. backgrounds and they all of same height.. Problem: I would like to add something to the BOTTOM of the side menu but am not able to do so.. this text has to appear at the bottom of the page even if content of side menu is less.. I could do "position:absolute" and give it top:870. but this is not dynamic as when the main content is larger it appears this text is in the MIDDLE rather than at the bottom? Greetings, I have a 3 column layout with a header, nav bar, content space and footer on the center column, making the center column have 4 rows. The content div's height is set to auto and it's overflow to auto so that when the browser is maximized on higher resolutions it will expand and contain the text without a scrollbar. alternatively it will give a scroll bar if the content div is shrunk below 300px. however the auto height on the content div is causing it to take up more room than necessary. if the window is shrunken down, the content text will leak out over the footer bar and beyond. Before i post code does anyone have any suggestions on what i should be looking for? If code is wanted lemme know. Greetings! I am trying to position a transparent gif at the bottom of a page, repeating on the x axis, so that text scrolls behind it. I have the gif fixed at the bottom of the page, but the text is still over top of it. I think I will need to create an element, position it at the bottom of the page, use the transparent gif for the background, and give it a z-index higher than zero, right? If so, I can't get it it to work! What I am currently doing: Code: body{ background:transparent url('/flames.gif') center bottom fixed repeat-x; } I'm trying to resize links on hover but doing so they change their vertical alignment during hover. Is there a way to prevent this ? Basically I just want the text to be bottom aligned and stay that way on hover. "text-align: top" works, but thats not what I want. simple example: CSS: Code: a:link, a:visited, a:active { font-size: 1em; } a:hover { font-size: 1.5em; } HTML: Code: <div> <a href="#">Text</a> </div> on my page http://tampabay-online.org/cetr/news/ the left side : Code: .content { position:relative; width:300px; margin-left: 155px; margin-top: 20px; border:1px solid black; background-color:white; padding:10px; z-index:3; } and the two on the right are : Code: #right { position:absolute; width:200px; top:20px; left:500px; border:1px solid black; background-color:white; padding:10px; z-index:1; } #sidebar { position:absolute; width:200px; top:400px; left:500px; border:1px solid black; background-color:white; padding:10px; z-index:1; } If someone has a their font bigger on the artists section then the div will grow and go under the sidebar div. Any way to make these relative or fix that problem? Thanks! this is bugging the hell out of me, cant find a working answer anywhere (i've tried a bunch of things) So I have 3 images for the top of my page and 3 images for the bottom. The page is enclosed in a div frame titled "frame" each of the 3 columns is enclosed in a frame "leftframe" "centerframe" and "rightframe" Each of the 3 columns has a top which is a fixed size image at the top, a middle which is just empty space for content to go, and a bottom which is a fixed size image at the bottom. Problem: I can't get any of the 3 column's bottoms to stick to the bottom of "frame" I've tried some code in here to do it and it doesn't work.. any help here? thanks! Code: <style type="text/css"> body { text-align:center; height:100%; min-height:100%; padding:0px; } #frame { width:800px; height:100%; min-height:100%; margin-right:auto; margin-left:auto; margin-top:0px; padding:0px; text-align:left; position:relative; } #contentlefttop { width:155px; height:282px; padding:0px; float:left; background-image: url(images/layout_01.gif); background-repeat:no-repeat; } #leftframe { float:left; width:155px; position:relative; height:100%; min-height:100%; } #contentleft { clear:left; float:left; padding:0px; width:155px; padding-bottom:270px; } #contentleftbottom{ width:155px; height:270px; /*clear:left; float:left;*/ padding:0px; position:absolute; bottom:0; background-image: url(images/layout_07.gif); background-repeat:no-repeat; } #contentcenter { width:486px; padding:0px; clear:left; float:left; text-align:center; min-height:100%; height:100%; padding-bottom:53px; } #rightframe { float:left; position:relative; height:100%; min-height:100%; width:159px; } #centerframe { float:left; position:relative; height:100%; width:486px; } #contentrighttop { width:159px; height:282px; padding:0px; clear:left; float:left; background-image:url(images/layout_03.gif); background-repeat:no-repeat; background-position:top; } #contentright { clear:left; float:left; width:159px; padding:0px; height:100%; padding-bottom:270px; } #contentrightbottom{ width:159px; height:270px; /*clear:left; float:left;*/ position:absolute; bottom:0; padding:0px; background-image: url(images/layout_08.gif); background-repeat:no-repeat; background-position:bottom; } #contentheader { width:486px; height:135px; float:left; background-image: url(images/layout_02.gif); background-repeat:no-repeat; } #contentfooter { /*clear:left; float:left;*/ width:486px; height:53px; background-image: url(images/layout_09.gif); background-repeat:no-repeat; position:absolute; bottom:0; } #sitemessage { margin-left:17px; margin-right:31px; height:90px; text-align:center; font-size:12px; } #wisemanquote { margin-left:22px; margin-right:24px; height:85px; text-align:center; font-size:12px; } p,h1,pre { margin:0px 10px 10px 10px; } h1 { font-size:14px; padding-top:10px; } #contentheader h1 { font-size:14px; padding:10px; margin:0px; } #contentright p { font-size:10px} </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body bgcolor="#FFFFFF"> <div id="frame"> <div id="leftframe"> <div id="contentlefttop"> <div id="sitemessage"></div> </div> <div id="contentleft">Left</div> <div id="contentleftbottom"></div> </div> <div id="centerframe"> <div id="contentheader"></div> <div id="contentcenter"> <p>Center</p> </div> <div id="contentfooter"></div> </div> <div id="rightframe"> <div id="contentrighttop"> <div id="wisemanquote"></div> </div> <div id="contentright">Right</div> <div id="contentrightbottom"></div> </div> </div> Figured this was simple, but I can't seem to figure it out. Using CSS, I want to put an image on the left with text to the right aligned to the bottom. I could easily do this with a table, but I'd like to find a CSS way. With CSS like: .imginfo {float:none;clear:both;margin-top:1em;} .imginfo img {float:left;margin-right:1em;} and code like: Code: <div class="imginfo"> <img src="..." /> Line of Text<br /> Line of Text<br /> Line of Text<br /> </div> I get the image on the left and the text on the right, but, the text starts at the top of the image. I want it to end up aligned to the bottom of the image. Attempting to use vertical-align: bottom doesn't do anything with the text. The effect I am looking for is like below. If you assume the XXX are the image... Code: XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX Line of Text XXXXXXXXXXXX Line of Text XXXXXXXXXXXX Line of Text I am trying to position a footer at the bottom right hand corner of the page with style
Code: {position: absolute; bottom: 0px; right: 0px;} However, the footer is not lying on the bottom, its about an inch off the bottom, interfering with a form field. How do I fix this? I can't create a complicated webpage without using absolute positioning for areas. For ex I want to create 2 top areas of screen width on top of page. Then I want 3 columns with 1st and 3rd columns having 3-4 seperate containers. Without using absolute I am way to confusied to get this happening. When using Absolute positioning is it best to have the first <div> be static so that that the Absolute Positioning has something a reference point? Thank you |