CSS - Line Break Problem
This is probably the dumbest question ever, but I hardly ever work on GUI stuff anymore so here it goes...
I have some buttons that have their size (height and width) controlled by CSS. The text I'm putting on them is sometimes too long to fit unless it would wrap, but it doesn't want to wrap, it wants to disappear off the side of the button. Is there a way to explicity tell it to wrap if it needs to, or even insert a "new line" character? Thanks! Similar TutorialsHow do I create two div blocks that lay side by side from each other? Right now I have two "column" divs (one left and one right), and separate "box" div that contain the content. CSS: Code: div#frame { width: 40%; margin-top: auto; margin-bottom: 50px; margin-left: auto; margin-right: auto; border-style: solid; border-width: 5px; border-right-color: black; border-bottom-color: black; border-left-color: white; border-top-color: white; } div#title { width: 100%; background-color: black; color: white; } div.box { width: 100%; border-style: solid; border-width: 5px; border-right-color: black; border-bottom-color: black; border-left-color: white; border-top-color: white; } div#left { width: 45%; } div#right { width: 45%; margin-left: 50%; } HTML: Code: <div id="frame"> <!---------------------------> <div id="left"> <div class="box"> <div id="title">NEWS</div> fsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jkl</div> <div class="box"> <div id="title">RECENT GAMES</div> fsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jkl</div> </div> <!---------------------------> <div id="right"> <div class="box"> <div id="title">NEWS</div> fsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jklfsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jkl</div> <div class="box"> <div id="title">RECENT GAMES</div> fsdf ksdlfj klsdjf l;ksdjf skdfj sdf klsdf klsdf jksd jksdfjklsdf kljsdfjkl sdl;ksdfj l;ksd flsdf sdf sdfjklsdf jklsd jkl</div> </div> </div> Link: http://mushsauce.110mb.com/art.html Below is my CSS file for list. Code: li { list-style-position: outside; } ul { list-style-position: outside; list-style-type: disc; margin-left: 15; } ul ul { list-style-position: outside; list-style-type: circle; margin-left: 25px; } ol { list-style-position: outside; list-style-type: upper-alpha; } ol ol { list-style-position: outside; list-style-type: decimal; margin-left: 25px; } ol ol ol { list-style-position: outside; list-style-type: upper-alpha; margin-left: 35px; } Now, here's the problem. When I do this: Code: <b>Section Title</b> <ul><li>List 1</li> <li>List 2</li> <li>List 3</li> </ul> The result showed up like this: Section Title *List 1 *List 2 *List 3 Is there a way to not having the line break after the "Section Title"? I want it to show up like this: Section Title *List 1 *List 2 *List 3 How to I take out the extra line break? Any help is grateful! ljCharlie Hi im having trouble with a padding problem. I have a paragraph with a background color, and I need the paragraph to be on two seperate lines so I add the <br> tag and when i do this happens. http://www.sloweducation.com/la.htm You see, it only does the padding-left on the top line.. is there a way I can make it pad the bottom line also? I dont know what to do at all. Thanks. Hi, folks. I'm having a curious problem with the navigation on my page. I'd like the nav and header to be all on the same line. It works when I just include the nav icons as images directly in the HTML. But when I make the nav icons into links, set each link to display:block, and give it the appropriate background-image, it puts all the icons on a new line. I'm not sure why. Any ideas? You can see the page with the problem and the effect I'm trying to achieve at these two TinyURLs: Problem: TinyURL dotcomslash a8qnky Working: TinyURL dotcomslash 8tj29l (The HTML validates, and the CSS validates except for the IE PNG transparency fix. I'm still experiencing this problem without that fix in place.) Hi, What is my CSS file is making my <p></p> tags not break a line? My css file is located he Code: /* Theme Name: U5 Theme URI: (URL address blocked: See forum rules) Description: This theme is form <a href="utombox.com">UtomBox.com</a>. Version: 6.11 Author: Utom Author URI: (URL address blocked: See forum rules) */ * { list-style:none; text-decoration:none; margin:0; padding:0; } blockquote { margin-left:15px; background-color:#F8F5D1; border-left:5px solid #F9CA68; border-right:1px solid #F9CA68; border-bottom:1px solid #F9CA68; border-top:1px solid #F9CA68; margin-right:15px; padding:4px; } .navigation { font-family:"Trebuchet MS", Verdana, sans-serif; margin-bottom:5px; font-size:12px; } .navigation a { color:#3E6697; text-decoration:none; } .navigation a:hover { color:#3E6697; text-decoration:underline; } .navigation .alignleft { float:left; } .navigation .alignright { float:right; } .post { margin-right:10px; clear:both; border-bottom:1px dotted #999999; margin-bottom:5px; padding-bottom:10px; margin-top:10px; } .post h1 { font-size:30px; font-family:"Trebuchet MS", Verdana, sans-serif; } .post h1 a { color:#4374b0; text-decoration:none; padding-left:1px; padding-right:1px; } .post h1 a:hover { color:#4374b0; text-decoration:underline; padding-left:1px; padding-right:1px; } .post h2 { font-size:20px; font-family:"Trebuchet MS", Verdana, sans-serif; } .post h2 a { font-size:20px; color:#4374b0; text-decoration:none; padding-right:1px; margin-top:5px; } .post h2 a:hover { font-size:20px; color:#4374b0; text-decoration:underline; padding-right:1px; margin-top:5px; } .post small { font-size:10px; color:#666666; font-family:Verdana, Arial, Helvetica, sans-serif; } .post small a { color:#3E6697; text-decoration:none; } .post small a:hover { text-decoration:underline; } hr { clear:both; border:0px; background-image:url(/images/hor_div.gif); background-repeat:repeat-x; height:1px; background-color:#FFFFFF; padding:0px; } body { overflow:auto; background:#fff; color:#fff; font-size:11px; line-height:22px; font-family: "Verdana", Lucida Grande, Arial, Helvetica, sans-serif; } p { font-size:11px; margin:0; margin-bottom:15px; } p a { color:#333; text-decoration:none; margin:0; margin-bottom:15px; } p a:hover { color:#333; text-decoration:underline; margin:0; margin-bottom:15px; } h1,h2,h3,h4,h5,h6 { font-family:"Trebuchet MS"; } p,.entry ol,.entry ul { margin:0; } .entry ol,.entry ul { padding:0; } .entry strike{ text-decoration:line-through; } input,textarea { background:#fff; border:1px solid #999; font:11px "Verdana", Arial, Helvetica, sans-serif; color:#333; padding:2px; } input[type=text]:focus,textarea:focus { background:#fff; border:1px solid #666; font:11px/150% "Verdana", Arial, Helvetica, sans-serif; color:#333; } #wrapper { background:#fff url("images/bg.png") repeat-y center center; margin:0 auto; padding:0 5px; } #header { height:100px; } #headerimg { height:100px; } #headerimg h1 a { background:transparent url("images/logo.png") no-repeat 0 0; position:absolute; width:180px; height:100px; overflow:hidden; text-indent:400px; line-height:200px; } #headerimg .description { display:none; } #box { padding:0 20px 20px; } #content,#sidebar { float:left; margin:0 20px 0 0; } #content { width:550px; color:#333; } #content2 { width:550px; color:#333; float:left; margin:0 50px 0 0; } .narrowcolumn a { color:#333; text-decoration:underline; margin:0; margin-bottom:15px; } .narrowcolumn ul.u_datetime { background:#666 url("images/datetime.png") no-repeat 0 0; width:60px; height:60px; float:left; text-align:center; color:#FFF; margin:0 10px 0 0; } .narrowcolumn li.u_month { font-size:10px; line-height:20px; } .narrowcolumn li.u_day { font-size:20px; font-weight:700; line-height:20px; } .narrowcolumn li.u_year { font-size:12px; font-weight:700; line-height:20px; } .narrowcolumn h2 a { color:#4374b0; font-size:20px; margin:0; } .narrowcolumn .u_tag,.narrowcolumn ul.u_postinfo li { line-height:23px; margin:0 10px 0 0; padding:0 0 0 20px; } .narrowcolumn .u_tag { background:transparent url("images/tag_blue.png") no-repeat left center; } .narrowcolumn .u_author { background:transparent url("images/user.png") no-repeat left center; } .narrowcolumn .u_timepost { background:transparent url("images/time.png") no-repeat left center; } .narrowcolumn .u_category { background:transparent url("images/folder.png") no-repeat left center; } .narrowcolumn .u_comment { background:transparent url("images/comments.png") no-repeat left center; } .narrowcolumn .entry { clear:both; padding:10px; overflow : hidden; } .narrowcolumn .entry blockquote { border-left:2px solid #fff; color:#666; margin:0 0 0 2em; padding:0 0 0 2em; overflow:hidden; } .narrowcolumn .entry ol li { list-style:decimal; } .narrowcolumn .entry ul li { list-style:disc; } .narrowcolumn .entry img { margin:5px; } .narrowcolumn .entry a:hover img { border:0px solid #FFF; } .narrowcolumn .navigation { height:20px; margin:0 0 20px; } .narrowcolumn .navigation_page a,.narrowcolumn .navigation_page .utompage{ font-size: 10px; float: left; height: 20px; padding: 0 5px; line-height: 20px; margin: 0 1px 1px 0; } .narrowcolumn .navigation_page a{ background: #fff; border:0px solid #fff; color: #666; } .narrowcolumn .navigation_page a:hover, .narrowcolumn .navigation_page .utompage{ color: #4374b0; background: #fff; border:0px solid #fff; } .narrowcolumn .alignright { float:right; } .narrowcolumn .postmetadata { border-top:1px solid #fff; border-bottom:1px solid #fff; margin:20px 0; padding:10px; } .narrowcolumn .postrss2 a { background:transparent url("images/rss_big.png") no-repeat 0 0; position:absolute; width:80px; height:80px; overflow:hidden; text-indent:400px; line-height:200px; margin:-5px 0 0 400px; } .narrowcolumn .postmetadata li { line-height:23px; padding:0 0 0 20px; } .narrowcolumn .postdatetime { background:transparent url("images/time.png") no-repeat left center; } .narrowcolumn .postcategory { float:left; background:transparent url("images/folder.png") no-repeat left center; margin:0 10px 0 0; } .narrowcolumn .posttag { float:left; background:transparent url("images/tag_blue.png") no-repeat left center; } .narrowcolumn .posttrackback { clear:both; background:transparent url("images/arrow_refresh.png") no-repeat left center; } .narrowcolumn .postedit { clear:both; background:transparent url("images/pencil.png") no-repeat left center; } span.ugr { float:left; width:50px; height:50px; border:0px solid #666; margin:0 3px 3px 0; } .narrowcolumn h3#comments,.narrowcolumn h3#respond { font-size:15px; margin:10px 0; } .narrowcolumn ol.commentlist { border:0px solid #666; border-bottom:none; margin:0 0 20px; } .narrowcolumn ol.commentlist li { border-bottom:0px solid #666; background:#fff; padding:10px; } .narrowcolumn ol.commentlist li.alt { background:#fff; } .narrowcolumn .commentlist .uar,.narrowcolumn .commentlist .uar a { font-size:14px; font-weight:700; color:#333; } .narrowcolumn .spost,.narrowcolumn .commentlist p { clear:both; } .narrowcolumn #comment { width:80%; } My homepage is he Code: tonycai.com As you can see my paragraphs doesn't break a line. Thanks Hi all, I've created a template in CSS and divs, but when someone puts a word like this_is_a_template - with no spaces in it, it breaks the left nav. Is there any way of making sure words break once they get to the width of the leftnav, even when they don't have spaces in them? Cheers. try to make a UL into a horizontal nav. i want the a's inside the li's to be display:block, so i need a block element around the outside, but that means they wrap to new lines. What is block without new lines? thanks. Anyway to remove the automatic line break after list items? I'd like to use styles to create roll-over effects in a menu I've used an unordered list to create that menu. But, I'd like a horizontal menu bar rather than a vertical menu column. Thanks! David Goldfeder I am having two problems with a theme I have for PHPBB3. One problem is the text that you type into textboxes when making a new post, updating your profile, or a few other spots is white on a very light grey background; therefore, hardly showing up. The second problem is that the page display a white line at the bottom of a few pages (but not others) and the line goes away if you resize the IE window smaller, but reappears again if you full screen it. I know the first problem has to exist in the stylesheet.css file; however, I am not sure where to make these changes as I am not familiar with PHPBB stylesheets. If anyone could help it would be greatly appreciated. Thanks! Forums: Click Here Stylesheet: Click Here Pictures of my problems: Text problem- Line Problem - I have a search box/button I want to keep on a single line in a tool bar on my page in strict XHTML/CSS. The <form> tag produces a line break beforehand. In old HTML I could put the <form> tag outside of the table row or data tags, but XHTML does not allow that (bad nesting). I found in devshed here to use style="display:inline;" which works! But the page does not validate as strict XHTML/CSS (using validator.w3.org). <table><tr><td> <!-- simplified to illustrate!! --> <form method="get" action="..." style="display:inline;"> <input type="text" name="q" size="10" maxlength="255" value="" /> <input type="submit" name="sa" value="go" /> </form> </td></tr></table> The Error and reason given is below. It seems that you can not have a block-level element (<input>) within in inline-level element (<form>). *** document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag. The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). *** Does anyone know how to code this to not have the linebreak and still maintain strict XHTML/CSS code? Hi, I'm having a problem with Firefox and a print-friendly stylesheet. Basically, I'm printing out a load of images - 9 per page, in 3 rows of 3. After 9 images, I'm printing a <div style="page-break-after:always;"></div> However, the problem I'm getting is that the 10th image, which appears at the top left of the next page, is missing. All of the other images on the page print, apart from that one. Has anyone else had the same problem, and is there a way around it. Other threads I've Googled suggest it's a bug in CSS2, but my boss/client won't accept that as an answer! Thanks in advance, Psycle I have an internal document that depends on page-break-after to separate the pages when it is printed. The attribute page-break-after:always had been working just fine. Now, I've noticed it is getting ignored on some users machines that have updated to IE8. I've never seen this problem in IE7 or Firefox, and I've also seen it work at times on IE8, though rarely. For the most part, users on IE8 are getting a document that treats it as only one page and will only print that first of 14 pages. Does anyone know about problems with this attribute in IE8 and what might need to be done to fix it. Aloha, I am trying to change the way a page on my site is printed. Currently, I have a Google ad that is far enough down the page that it causes too much content to be pushed to page 2. I know I should post a link to the page, but I am still developing it and I only have it on my laptop rght now. Here are two screen clips from my print dialog that should illustrate the problem clearly: print1.jpg print2.jpg How do I allow the printer to go ahead and split the image in two putting the top part of the image at the bottom of page 1 and the bottom of the image part on page 2? TIA, Thad Due to letter-spacing double break won't work in IE. And triple break works as it is double break. How to solve this problem? w3 css-validation tool Quote: context:html body Property word-break doesn't exist : break-all it doesnt validates ,, why?? It changes both attribute in ie and firefox,, I use it because when people choose bigger text sizes my divs mix up because of long words so I use word-break. What do you prefer me?? Live without validation Hi all, I am trying to do a bottom line (contact info) in a css layout. I am having the content area (98% height) and a bottom line (3%). (101% because I want the scrollbar to be visible - FF jumping) Now the problem is that FF interprets the 98% as 98% of the current window height. Even if the text is larger. The bottom line then appears right in the middle of the text. Example IE interprets the height of the text (a nice little bug), but it works and displays the bottom line at the end of the page. Here's the css for the containers: Code: #Container { height: 98%; width: 100%; background-image: url(img/main_background.jpg); background-repeat: no-repeat; background-position: center top; min-height: 551px; } #Impressum { width:662px; height: 3%; height:auto; margin-right: auto; margin-left: auto; } Can someone give me a hint how to solve this FF problem? Thanks in advance Sven hey guys i'm having a problem with CSS line spacing. firefox is displaying correctly of course, and IE is scrunching the lines closer. here is an example (firefox on the right, IE on the left): here is the CSS: Code: #galleriesTextContainer { height: 130px; margin: 0px; padding: 0px; margin-left: 8px; line-height: 8pt; } .galleriesText { margin: 0px; padding: 0px; color: white; font-family: Arial, Verdana, Sans Serif; font-size: 11px; } Code: <div id="galleriesTextContainer"> <span class="galleriesText">dolphy day 2005 (132 images)<br />dolphy day 2004 (101 images)<br />buffalo wild wings (47 images)<br />lemoyne 2005 (425 images)<br />lemoyne 2004 (28 images)<br />lemoyne 2003 (147 images)<br />syracuse nationals 2004 (43 images)<br />nyc / jersey 2005 (245 images)<br />minutes monte (29 images)<br />my truck (67 images)<br />phil's t-type (70 images) </span> </div> Hi all, hope someone can help with this. Page with problem: html Code: http://central12.com/hovv.htm CSS Code: http://central12.com/hov.css Basically I used Eric Meyer image pop up tuturial, got it working ok in firefox, but in IE when I hover over the link the text jigs down a bit. I know I can stop this by removing the line-height attribute on the p tag, but wanted this to remain as it is a style I want across the site in general. Any way to keep the line height and remove the IE text jog. Thanks for any help. Hi all -- I've been messing w/ this for awhile and don't know why it isn't doing what I want. I have some headings, and the color, size, etc. all work but when the heading wraps to the next line, they are too close together... I've tried everything I can think of, like line-height normal, inherit, pixels,percent, you name it, doesn't change. here is a page example: http://www.keepsakequilting.com/landing/halloween2010.aspx they are the pinkish headings near the images.. here is the css I have: #lpage-titlel { font-family:century gothic,avant garde,arial,sans-serif; color:#AD4266; font-size: 110%; line-height:normal; font-weight: bold; padding: 0; margin: 8px 2px 5px 17px; text-align: left; } #lpage-titler { font-family:avant garde,century gothic,arial,sans-serif; color:#AD4266; font-size: 100%; line-height:normal; font-weight: bold; padding:10px; margin: 8px 2px 5px 5px; text-align: left; } #lpage-titler a {color:#AD4266;text-decoration:none;} #lpage-titler a:hover {color:#AD4266; text-decoration:underline;} #lpage-titlel a {color:#AD4266; text-decoration:none;} #lpage-titlel a:hover {color:#AD4266; text-decoration:underline;} What am I missing?? Any help would be greatly appreciated. THANKS Hello, I'm trying to make a autostrech page with CSS. I'm having a problem where a DIV jumps down a line instead of compressing. Here is a link to the problem page: http://www.nexpost.net/community/te...rall_header.htm Try resizeing it in your browser. Has anyone had a similar problem? Any fixes? Thanks for any help. |