HTML - How To Center Text Across Page When Image Is On Same Line As Text
here is the (ineffective) code currently:
<img style="float: left; width: 169px; height: 73px;" src="img/logo1.png" alt="" /> <h1 style="text-align: center;">random text</h1> the image shifts the left margin such that the text is centered as though the page width was 169px less than it really is. i'm not debating the code itself; the code above behaves as its meant to. aka no surprises. i just cant figure out the appropriate code to center the text across the entire real width of the page as though there was no image. i've tried div tags & all the things google hunting advised. no luck. other than finding this forum, which seems like it'll be a boon! thanx in advance for advise/comments/feedback/help. Similar TutorialsI am trying to do something pretty basic, but I dont understand the behavior or how to fix it. I want something to look like (where the '*' are centered): Code: * * test * * * * and am using the code: Code: <CENTER>*</CENTER> <CENTER>*</CENTER> test<CENTER>*</CENTER> <CENTER>*</CENTER> <CENTER>*</CENTER> <CENTER>*</CENTER> But the output looks like: Code: * * test * * * * when i center the search and quick link box at the top using a line height of 100.... it pushes the header image down 12px's... and spaces the header from the body of the page... any fix? http://www.pzproductions.com/home Hello all, I'm a newb at html, just started some basic coding last week. I've made my first site, though as you can see, the images and text (even if it's a placeholder right now) aren't lined up, and I'm not sure how to tell it to do that. Anybody with more expertise understand my situation, and how to fix it? Thanks! http://elliottetzkorn.com Hi guys, I got a quick question. I can't for the life of me understand why the youtube, facebook and twitter images below absolutely insist on having a few pixels of space to the bottom of it's line. It makes it so the following link-text seem to be too low on the line in comparison to the image. If you see in the lower left corner of www.leveldance.com you can see what i mean. Any ideas? (I have no padding added in the css) Thanks a million in advance! HTML Code: <div class="left_col_container"> <div><img src="images/navigation/sociables_headline.png" alt="Join Our Community!"/></div> <p style="margin-top: 5px; margin-bottom: 0px">Join the newsletter!</p> <style type="text/css">.af-form {margin:0 !important;}</style> <script type="text/javascript" src="http://forms.aweber.com/form/36/693624936.js"></script> <div style="margin-top: 5px"> <a class="sociables" href="http://www.facebook.com/leveldance" target="_blank"><img src="images/sociables/faceBook-icon.png" class="no_border" alt="Find us on Facebook!"/></a><a class="sidebutton" href="http://www.facebook.com/leveldance" target="_blank"> Find us on Facebook!</a> </div> <div style="margin-top: 5px"> <a class="sociables" href="http://www.twitter.com/leveldance" target="_blank"><img src="images/sociables/twitter-icon.png" class="no_border" alt="Follow us on Twitter!"/></a><a class="sidebutton" href="http://www.twitter.com/leveldance" target="_blank"> Follow us on Twitter!</a> </div> <div style="margin-top: 5px"> <a class="sociables" href="http://www.youtube.com/user/leveldancenyc" target="_blank"><img src="images/sociables/youtube-icon.png" class="no_border" alt="See us on YouTube!"/></a><a class="sidebutton" href="http://www.twitter.com/leveldance" target="_blank"> See us on YouTube!</a> </div><br/> </div> <!-- left_col_container end --> I have several websites that I maintain and update. A lot of them are just textual changes and I would think my customers can do these themselves by editing a simple .txt file. I was hoping my choices are avalable so that I can just insert this tag into my web pages and then give them login info to their edit page or show them how to upload the .txt file. I hope this is an easy one with several answers. Is it possible these tags could discipline your rankings in the search engines? Thanks, Jason Hi, I would like to know if I can make the background image (over which I will write the content of the page) to fit the space I'm using. For example, I don`t how to explain it , but I see sites with the navigation bar image or the content image to adapt its size according to the amount of text on them. And then it seems like they are infinite, again, it adapts to the isze of the page. But my background image stays the same size all the time and I can see the end of it. I know I didn`t explain it very well but I don`t know exactly what I need to do this so, if someone could help me, thanks a lot. i have a lot of text files(2-400) all have quite alot of text inside them so is there some software that can help me convert it all into html pages?? somthing that i am doing right now is: copied all of my text files pasted them into other location and editing each file and giving extention html/htm. now can u tell somthing better?? all the files will open in same frame(obviously one at a time), all have styling n everything same. hey guys, In order to align text isnt the command something like this? <h3 align="center">Text Here</h3> Is this right? I know its something really simple just for some reason I cannot get my text to center in the webpage. Any suggestions? Many thanks in advance! Hello everyone, would someone please help me with just vertically centering the text within the box that says "This page was last updated on Monday, May 16, 2011 @ 10:39 AM" it's for my site located @ http://www.trillionaireme.com Here is my CSS code: Code: body {background-color:#ffffff;border-style:solid;border-width:5px;border-color:gray;border-bottom-color:#ffffff;border-left-color:#ffffff;border-right-color:#ffffff;} h1 {background-color:#f5f5f5;font-size:17px; color:grey; font-family:arial;word-spacing:30px;text-align:center;} h2 {font-size:17px; color:grey; font-family:arial;word-spacing:30px;text-align:center;} p {font-size:11px; color:grey; font-family:arial;} p.bordertop {border-style:solid;border-width:5px;border-color:gray;border-top-color:#ffffff;border-left-color:#ffffff;border-right-color:#ffffff;} p.borderbottom {border-style:solid;border-width:5px;border-color:gray;border-bottom-color:#ffffff;border-left-color:#ffffff;border-right-color:#ffffff;} IMG.displayed {display:block; margin-left:auto; margin-right:auto;} a:link {color:grey; text-decoration:none;} a:visited {color:grey; text-decoration:none;} a:hover {color:#c0c0c0; text-decoration:none;} a:active {color:#c0c0c0;text-decoration:none;} div.page {width:920px;padding:0px;border:0px;margin:0px auto;} div.logo {width:200px;padding:0px;border:0px;margin:0px auto;} div.topleftbox {width:250px;height:250px;padding:0px;border:1px;border-style:solid;border-color:#dcdcdc;position:relative;top:20px;left:1px;font-size:11px;color:grey; font-family:arial;} div.topmiddlebox {text-align: center;width:375px;height:25px;padding:0px;border:1px;border-style:solid;border-color:#dcdcdc;position:relative;top:-15px;left:270px;font-size:11px;color:grey;font-family:arial;text-align:center;margin-} div.toprightbox {width:250px;height:250px;padding:0px;border:1px;border-style:solid;border-color:#dcdcdc;position:relative;top:-15px;left:394px;font-size:11px;color:grey;font-family:arial;text-align:right;} My html code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><title>TrillionaireMe</title><link rel="shortcut icon" href="images/trillionaireme.ico"> <head><link rel="stylesheet" type="text/css" href="trillionaireme.css" /></head><body> <h1> </h1><div class="logo"><a href="http://www.trillionaireme.com"> <img class="displayed" src="http://www.trillionaireme.com/images/trillionaireme.jpg" width="196" height="233" border="0" /></a></div> <h1> </h1> <p class="borderbottom"> </p> <div class="page"><h2> <a href="http://www.trillionaireme.com/fitness.html">Fitness</a> <a href="http://www.trillionaireme.com/nutrition.html">Nutrition</a> <a href="http://www.trillionaireme.com/money.html">Money</a> <a href="http://www.trillionaireme.com/relationships.html">Relationships</a> <a href="http://www.trillionaireme.com/parenting.html">Parenting</a> <a href="http://www.trillionaireme.com/music.html">Music</a> <a href="http://www.trillionaireme.com/literature.html">Literature</a> <a href="http://www.trillionaireme.com/you.html">You</a> <a href="http://www.trillionaireme.com/them.html">Them</a> <a href="http://www.trillionaireme.com/vision.html">Vision</a></h2> </div> <div class="page"> <div class="topleftbox">This is the top left box. <div class="topmiddlebox">This page was last updated on Monday, May 16, 2011 @ 10:39 AM <div class="toprightbox">This is the top right box. </div></div></div></div> </body></html> I have found out that the <center> tag </center> is now obseolete eventhough broswers still display it. I was wondering on how i go about centering text so that it does validate according to xhtml standards. Thanks. I have seen this many times but can not figure how to do it. Its the transparent images or text in text boxes, one example of this is http://au.movies.yahoo.com/Coming+Soon/to-cinemas/ At the top right you can see that transparent yahoo image in the text box and when you click it it disappears then comes back? can someone tell me how this works? Thanks Hey everyone and thanks ahead of time for takin a look see at this! I'm working on creating a headline for one of my pages that I want to have some sort of 'text' decoration on each side of it like this: -----[blah blah]------ Now I want the title ('blah blah' in this case) to be in a <h1> tag...but not the decoration on the outside. However when I set it up like: Code: ----[<h1>blah blah</h1>]---- As you would guess the result is: -----[ Blah Blah -----] Is there someway I can keep these inline, but still have an <h1> tag wrapped only around the title? THANKS!! Hi all, I have the following code... <BODY> <ul> <li><h3> hello world</h3> I love you </li> </ul> </BODY> Right now this comes out on two separate lines. Is it possible for both texts to be on the same line? Thanks. http://credmond8.awardspace.com/home.phtml How can I get "Site Theme" and "Time" on the same line? please, check http://members.dodo.com.au/~rouslan/...ite/index.html I need to know how to get rid off strange effect down the bottom and how do I make text and image aligned on the same "line", "level" e.g. image image text text text text text text text text image image text text text text text text text text image image text text text text text text text text image image text text text text text text text text Hi, I am writing various things on one line - such as Previous, Back to Main Menu and Next - but would like to align the differently e.g. I would like "previous" to be aligned to the left of the page, "back to Main Menu" in the middle and "Next" on the right side. I have tried pressing space bar - but am only able to do one space in Dreamweaver. Any ideas? Thanks. Hi guys, can someone help me. I'm trying to get my text to sit like this: however it sits like this: www.studioeighty.co.uk thanks Steve Hi, I am doing a small project. In that I am displaying percentage visually with the help of horizontal line using width. when the user places cursor on that line, is there any chance to show percentage of that line. Eagerly waiting for your replies. Thanks in advance, Hi, I want to create a header (<h1>,<h2>,...) like on the picture (see attachment) with html and css. It is possible to create sth like that without using pictures? Thanks |