HTML - How To Set The Width Of A Block Of Text?
Hi,
In my site: www.theticketsguide.com I am trying to set the width of the text "This is a test. Sample content..." to only span about half the page. This is the code I have so far: <font style="color: rgb(204, 204, 204);" size="6" width="440" ><span style="font-family: Arial,Helvetica,sans-serif;">This is a test. Sample content will go here. Sample content will go here. Sample content will go here.</span></font></h1> The width function isn't working. What am I doing wrong? Thanks, Brandon Similar TutorialsI'm having some trouble figuring out what the best way to implement something is. I have a <div> with a <button> in it that has some text. I'm using niftyCorners to round the div corners, and the div needs to be a block level element because if I make it inline, the background disappears after it is rounded. My problem is that I only want the div to be as wide as the text in it, because the div is what is providing the background and rounded corners and such for the button. Is there a good way to implement this? All I can think of is floating the div which would be a PITA or trying to set an explicit width with JS or something. im creatinh a box containing a text. The box must be wide enough to fill a text. menu.style.width = tekst.length - this functioin gives the number of letters in text. So if the text is "hello" then the width is 5 pixels. But i need the widith of pixels needed to fit the text in a box. How can i do that? Dear all, How can I get a block of text to appear in its own coloured box? I want to display some BlitzBasic code like this... ... but at the moment, I'm doing it like this, padding it out with spaces... Code: <p><span style="background-color:#D1D1FF;"><tt> Graphics3D 640,480 <br /> SetBuffer BackBuffer() <br /> cam=CreateCamera() <br /> light=CreateLight() <br /> cube=CreateCube() <br /> PositionEntity cube,0,0,5 <br /> tex=LoadTexture("brick.png")<br /> EntityTexture cube,tex <br /> While Not KeyDown(1) <br /> RenderWorld <br /> Flip <br /> Wend <br /> End <br /> </tt></span></p> Is there a way to set the width - I can't seem to find one. Many thanks. T Hey all. I just recent finished the following site for a client: http://www.stagingupstyle.com/ My client would like me to change the formatting of the text on the "Designer" page to be block text like a news paper. Does anyone know how to do this? Here is an example of block text. http://www.readingonline.org/article...r/image1ri.gif Hello, I want to block off my website without Uploading a Website closed HTML file. Is there a possible way to do it? If you have no idea what im talking about, please look at Limewire website. It has a thing that pops up and blocks off the site. I want it exactly like that. Thanks in advanced! (and dont judge me, this is my first forum post) Hi. I am currently struggling to find a simple sollution to the following issue. I want to render out a text input box in HTML that will have a block (with borders) for every character. I can think of really tedious solutions that will involve a table with an input tag per cell but this will be nasty if something else is available. The solution is only for IE and cannot involve any ActiveX components due to security issues. So is there any easy way to basically create internal borders in an input or textbox tag that will separate the characters for me? Thanks. Does anyone have an idea how I can make the text in the TD-tags fit 100% in its cell. Help would be highly appreciated. Quote: <html> <style> .text {text-transform: uppercase; } </style> <body> <center> <table width="500" border="1"> <tr> <td> <span class="text">Text nrjkfb bfd df bfdfbhj</span> </td> </tr> <tr> <td> <span class="text">Text hjkbjkbjk</span> </td> </tr> </table> Reference: http://test5.waltonstreetwebdesign.com/contact.php So there are 3 text inputs there and 1 textarea, I need them to be the same width. The thing that I don't get is that each input has the same CSS class giving it a width. So why aren't my text inputs the same length as the textarea? I'm looking at this on a Mac, it's not the same width in both FF and safari. Thank you for the help! Here is a (very trimmed-down) version of my site: http://www.nceccec.com/en_us/css_test.html At least in IE6 and IE7, the top field does not display the specified left margin, while the bottom one correctly shows the left margin. There is only one difference between these two fields: the CSS property width is set on the first field, while no width is set on the second field. Here is all the code for this page in case someone wants to view it he HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Title</title> <style rel="stylesheet" type="text/css"> .fielditself { font-weight : normal; display : block; margin-left : 5%; } </style> <body> <table style="width : 100%;"> <tr> <td> <form method="post" action="check_order.php"> <div><div>Year</div><div class="fielditself"><input style="width : 9ex;" type="text" name="year" /></div></div> <div><div>Make</div><div class="fielditself"><input type="text" name="make" /></div></div> </form> </td> </tr> </table> </body> </html> Thanks for any guidance! Jason Hi All, Nice site BTW, my problem is i want to add some text with a background colour behind it but i want the background colour to stretch the full width of the page ? Can anybody help me out Thanks Hi, Is there away to force my website to fit an Iphone screen when viewed on the iphone. At the moment the width doesn't full span the Iphones screen so it looks bad. http://pjm.co.uk.uksite4.yourwebserv...splay&PageID=5 Thanks alot Joe Hello, i got a css theme, that i tried with tumblr, it didn't work, seems like that i have missed something. I can't upload, or post anything, ...well i can but from the CSS file, and it's kinda annoying. here's the theme. http://www.2shared.com/document/jTGY...e_tumblr_.html I tried to create the blocks, the following ones : http://skeedio.com/tutorials/web-des...tumblr-themes/ But it did nothing, can anyone help/edit me ? please or can tell me what i've missed ? can i create the block from the css ? it seems that tumblr is more html...i'm newbie sorry ) Hi! I have a problem with a div in my website. As you can see, the text goes out of the div block. The text is in <pre> tags! I noticed that first the problem was because text isn't seperated, but it still goes out of the block. In FF I can use <pre width>, but this doesn't work in IE. How can I "force" the text in the block? Hello all. Is it possible to block multiple words in a search box using html or javascript? A search box on my own site. Example: writing "bad" in the search box will receive no results. Hoping for an answer Harold I have a Web Page with the following HTML code: <div id= "BlockA" > <div style="position:absolute;left:31.82px;top:79.70px" class="cls_005">Text 1</div> <div style="position:absolute;left:340.70px;top:79.70px" class="cls_005">Text 2</div> <div style="position:absolute;left:31.10px;top:92.90px"> <span class="cls_005">Text 3</span> <span class="cls_002">Text 4</span></div> <div style="position:absolute;left:105.02px;top:92.90px" class="cls_005">Text 5/div> </div> "BlockA" is usually displayed without highlighting. However, under certain circumstances (as controled by my Web App), I would like to highlight (e.g. with backgroundcolor = "yellow") "Block A" when the Web page is displayed. The highlight should not change the classes in the div and span within "BlockA". Can anyone suggest how can I do this? Thanks in advance. sg2000 What is the proper use of the ID and CLASS tags. I think I know but I'm not entirely sure. My understanding is that IDs and CLASSes do the same thing. Also, when it comes to the DISPLAY--hmm it's not a selector... modifier?--and its attribute is BLOCK; does that make it so that there's a line break after the </p> like a <br /> does? Thanks in advance for any help. Hi guys, im new to the forum, but you all seem friendly and helpful, so here goes! I'm doing a part-time Uni course 'Creating Websites using HTML', and my assignment involves building a website... simple as that Anyway, I have a question for you experts!... I'm using various PCs (work, home, uni), and whenever I save the files and email them to the next PC im using, when I view the HTML source (from IE - latest version), the text is automatically displayed in one long block!! This is very frustrating and time consuming as I have to break the text up, exactly as I originally typed it. Is there a way I can prevent this from happening? Thanks in advance for any help, Greg Hey everyone! I am a game developer and some of my games apear in Internet Explorer. The problem is that the players can resize the window if they got IE7 or IE8. On the previous versions this wasn't possible because I blocked it using HTML. How do I block this resizing option (100%..125%...) now? THANKS Hi, I was wondering if someone could explain block and inline elements. I know they deal with word wrap but, I have read and I am still confused on how you know what is a block element and what is an inline element. Can someone provide some aid? Thanks. |