CSS - Text Line Falls Outside It's Surrounding Div
Hi,
I'm trying to include some text within a div, but the last line always seems to fall outside the bottom border. An image of what it looks like is attached. Here's the html I'm using: Code: <div class="tbl-row <?php echo ($intRow % 2 == 0) ? ("tbl-row-odd") : ("tbl-row-even"); ?>"> <div class="title-lbl">Site: </div> <div class="title-text"><?php echo $aCols["site_name"]; ?></div> <img src="{ImgSpacer}" alt="" width="1" height="20" /><br /> <div class="contents-text"><?php echo nl2br($aCols["contents"]); ?></div> <div> <span class="subon-text"><?php echo $aCols["local_time"]; ?></span> <span class="subon-lbl"> at: </span> <span class="subon-text"><?php echo $aCols["local_date"]; ?></span> <span class="subon-lbl"> on: </span> <span class="subby-text"><?php echo $aCols["full_name"]; ?></span> <span class="subby-lbl">Submitted by: </span> </div> </div> and here's the css: Code: .contents-text { color : #F98537; font-size : 15px; text-align : left; } .tbl-row { border-radius : 15px; -moz-border-radius : 15px; -webkit-border-radius : 15px; margin-left : auto; margin-right : auto; padding : 8px; vertical-align : top; width : 96%; } .tbl-row-even { background-color : #FFEBCB; } .tbl-row-odd { background-color : transparent; } .subby-lbl { color : #F98537; display : inline; float : right; font-size : 15px; vertical-align : top; } .subby-text { color : #F0F; display : inline; float : right; font-size : 15px; vertical-align : top; } .subon-lbl { color : #F98537; display : inline; float : right; font-size : 15px; vertical-align : top; } .subon-text { color : #F0F; display : inline; float : right; font-size : 14px; vertical-align : top; } After much testing, I've found that it's the floats that seem to be causing the problem. When I take them out, the row is included within the outside div, but when I put them back in, the row falls outside. I need to keep the floats, because I would like to have the "Submitted" row aligned to the right, unless there's another way to achieve the same effect. So, does anyone know how I can have the last row right-aligned and included within the surrounding div? Debbie Similar TutorialsI would like to pop up the text, that is, make it bigger when the user hovers on it. but the problem everytime the text gets bigger, the whole row moves and the surrounding texts gets displaced. any idea ? tutorial? let me know if i need to explain more. I'm having problems with a div, a simplified example is at http://alphaworks.co.uk/test/child.htm (code below), basically I want the grey area to completely surround the image and the text. At the moment the grey area (a div) only goes to the bottom of the text and the image sticks out the bottom of it. Can someone explain why this is and what I can do to get it doing what I want it to? Many thanks, Geoff Code: <html> <head> <style type="text/css"> .child { border : solid thin blue; background : gray; } .child .thumb { float : left; } .thumb img { border : 1px solid black; } .child .text { margin-left : 220px; } .child .name { font-weight : bold; } .child .description { font-style : italic; } </style> </head> <body> <div class="child"> <div class="thumb"> <img src="" alt="Image" width="200" height="134" /> </div> <div class="text"> <span class="name"> Album name </span> <br/> <span class="description"> Album description </span> </div> </div> </body> </html> Hi all I'm building a photo gallery and have a problem. The main images have what looks like a dotted container box surrounding them when you click them. This box has padding either side which I want to either reduce to the size of the image or eliminate all together but don't know how to do this. The link is below. Click a thumbnail then click the larger image to see the dotted line. Thanks for any help. bajor.servers.rbl-mer.misp.co.uk/~sunridge/photob.htm i am working on an autocomplete, and in firefox it works beautifully, in IE when the drop down occurs it falls behind all the other content on the page. i have tried using z-index to bring it up and that didnt work, what else is there that i can do to try and get this to work? http://www itsdavesworld com / divbehind.jpg HI, Not only is this my first time posting, its my first site ever built using CSS (trying to learn as I go). The page displays fine in IE7 but my content boxes are outside of the wrapping container in Firefox, tried to figure it out myself, but don't really know enough yet. (URL address blocked: See forum rules) The CSS is embedded in the head of the page. Any help is much appreciated, Regards Fiona Hi everybody Is there a way to inherit the height of a surrounding table cell? <td> <a href="..." style="display: block;">...</a> <!-- Should have the same height as the td --> </td> Thanks for help :-) Josh i am trying to do something like: <h6>blah</h6><span class="note">*blah</span> but *blah is appearing underneath the h6 which is fair enough but how do i make it appear on the same line? i cant for the life of me think of a css property that lets me do that? I'm having problems getting my text to show up on the same line. I'm not sure what I'm doing wrong. Here is my code: Code: <div id="subtitle"><b>What Personal Information Is Collected?</b> <div style="font-size:7px"><a href="#whatinfo">SEE MORE DETAILS</a></div></div> The "subtitle" CSS is external: Code: #subtitle { font-family:sans-serif, arial, verdana; font-size:9pt; background-color:#cccccc; padding-left:6px; } I don't understand why the "SEE MORE DETAILS" link showing up on a second line? I want it at the end of my subtitle. Thanks for your help in advance. Hello, more issues(!) I'm using "text-decoration: line-through" to cross out retail prices - catalogue style. The trouble is, when the effect is used with certain numbers like "8" and "3", the numbers become unreadable and it looks like we're charging more than the retail price on some products. My boss likes the effect, so I need to find out how to raise the height of the line-through. Does anyone know how I can do this, or any other methods (such as border control) that will be more effective. Many thanks! i wish to have two bits of text show as described in subject this is the code i have at present. i know that i have used a style for an image but how do i do this for text ? thanks Code: <style> img.floatRight { float: right; margin: 15px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 3px; } </style> left text here<b class="floatRight"> right text here</b> Hi How can I wrap a long line of text inside a fixed width div? Hello, I have a problem that hopefully someone has seen before and found a solution. I have some text being displayed. When the text includes a image, in IE, it will repeat the last line of the text twice. so if I have this html Code: <div id="dorm_room_article_text"> <strong>HI</strong><br /> <br /> <br /> <img alt="image" src="some_image" width="525" /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> I love this game! </div> and this as the css Code: #dorm_room_article_text { float: left; clear: both; width: 100%; font-size: 95%; margin: 0 0 20px; } it will display: I love this game! I love this game! at the end, only in IE. I assume it has something to do with floats and displays but can't figure it out. Any ideas? Thanks. I'm not that familiar with css yet...so this might be a stupid question. I'm creating this website for my department. on the index page, there are several lists of links. between the links there is line spacing. but some link name is too long it got wrapped under. the wrapped under text also have line spacing. this makes the viewer feels that there are 2 links instead of one. how can i make the wrapped under text go right under without the line spacing? here is the link if you wanna see how it looks like now. http://www.scienceevents.uwaterloo.ca/ for example under the first left hand side menu, international year of astronmy is one link. but it looks like 2 links. how can i make them move together? this is the css for the primary nav Code: #primary_navigation { background:url(../images/primary_navigation_bg.jpg) no-repeat; /* This controls the background image on the home page. */ width:960px; height:200px; margin-top:20px; font-size:0.75em; clear:both; } #primary_navigation ul { list-style:none; margin-left:-20px; height:110px; } #primary_navigation ul li { line-height:2.0em; margin-right:5px; } Usiing ONLY CSS, is it possible to "justify" a block of text and have the last line centered? For example: Code: Fig. 13. Scatter diagram comparing two subspecies of Nyctimene albiventer. One individual of specimens thought to be intergrades is as large as specimens of Nyctimene a. bougainville, whereas the other three intergrades are about the same size as specimens of N. a. minor. CSS seems to only offer one or the other text-align:justify; or text-align:center; Thanks. Like on this page, under each of the photos: http://www.sdtars.com/development/events/camp.php What causes the text to appear like: Quote: Originally Posted by In IE Officers discuss TAR Days at an executive board meeting Hello everyone, I am trying to layout a small "table-like" system. I am running into problems formatting the text properly to fit in my design. Here is a link to my current progress: http://www.suicidenote.net/csshelp/test.html Here is a link to my css: http://www.suicidenote.net/csshelp/default.css I would be very pleased if anyone has any sugestions on how to make the text to vertically fit in the div. I would rather use css as I want a variety of pages to follow the style sheet, as well as database integration Thanks, Case Hello, I've been having trouble with a simple design I have been creating. I was wanting the footer text to display in a straight line, but it's displaying horizontally. Could you please look at my HTML and CSS coding and see if I had made an error: Code: www.wendyhenrichs.com/huy Thanks! Hey, Here is an example of code for one of my links where I attempted to align the link "Entry Form" to the middle of the image, what am I doing wrong? Code: <p class="NavigationOption" id="Nav_Entry" line-height=32px text-align=middle><img src="../links/entryform.jpg" border=0></img> <a class="NavigationLink" id="NavLink_Entry" href="<?= ptpr; ?>members/index.php"><font color= #555555>Entry Form</a></p> I want display a paragraph of which all the lines are indented except for the first line. I tried the following CSS: Code: .myclass:first-line { text-indent: 0; } .myclass { text-indent: 6em; } This achieves the reverse, only the first-line is indented. Can someone help? I have an alignment issue that is driving me crazy. For whatever reason, the text that I have in a <span> field is dropping too far down for the last line. Here is a screenshot of the relevant text: Yada yada For whatever reason I can't keep the final "Yada" from dropping farther down. It is in the following <td> field: Code: <td style="height: 200px; width: 150px; vertical-align: top; padding-top: 10px"> And the class for the span has the following characteristics: Code: .announcement_body { color: black; font-size: x-small; } I can't see what would cause this. I've already tried adjusting the height of the <td> field without any luck. I did get consistent spacing when I added the characteristics "vertical-align: middle", but that made the distance between every line too large. Any idea what I'm missing here? Stephen |