HTML - Align Div Without Margin-left: Tag?
Hello!
How can I center the divs and keep this arrangement? I have the bg centered and would like the divs to be also, without using the margin-left tag since it will only look centered on some screens. Thank you very much for your assistance! www.rkgrant.co.cc Similar TutorialsHi, Do you know the answer to this question? (I wasted a lot of time trying figure out this problem, before finally giving up.) How do I get the book cover image to display with no left margin, while preserving the 5px right margin? It displays with no left margin in my WYSIWYG editor. But, it displays with a 5px left margin in IE and Firefox. Here is the code... <a target="_blank" title="New Covenant Theology" href="/images/stories/book/book_cover_original_size.jpg"> <img style="border-style: none; border-width: 0px; left-margin: 0px; right-margin: 5px; title=" alt="New Covenant Theology" src="/images/150x199.jpg" width="150" align="left" height="199" /></a> 24 Reasons Why All Old Testament Laws Are Cancelled and All New Testament Laws Are for Our Obedience. See God's law in redemptive history explained simply and clearly with 7 diagrams, 20 charts, and 702 verses. Dedicated to Reformed, Covenant Theologians; Seventh Day Adventists; and other Sabbath-keepers. Read 3, free chapters from the book now: <a href="/new-covenant-theology.htm" title="New Covenant Theology"><span class="style20">New Covenant Theology</span></a></p> And, here is the webpage... http://www.jesussaidfollowme.org/#biblestudies Thanks for your insight, Greg Gibson The layout of my page, like that of many pages, consists of a bunch of divs inside divs. Whenever I specify the width or height of a div, there appears a space to its left, three pixels wide. This gap also appears when I substitute a standard image (img) for a div. Some of these divs are floated left; others are not. In the latter case, floating left actually gets rid of the space, but causes other problems as I don't really want those ones floated left. Setting the borders, margins, or padding to zero (or a negative number) does not affect the 3px gap. I am using IE7. Okay I know IE 7 problems are nothing new but being that I am fairly new at this and I am reading everything I can and I am still not catching up with how to correct it. I have the website up on a test server at http://www.vsncom.com/sterling I am working on a mac and the site works fine on IE 5.2 for mac and any other browser. However, IE7 causes a huge shift in the whole page to the left. And a few other elements are slightly shifted as well. The bottom nav is up a little higher than it belongs. The three pictures on the left are shifted further right. And that is all that I get shown when I capture the screen from net render and such. (Please look at attached picture to see what IE7 gives me) So, im not sure what else may be going on. If I can get the whole page to come back to the left then I can address the other issues maybe. But does anyone have any ideas how to do this. Please. I appreciate the help. I have been trying to figure this out for a week now and reading everything I can find online and trying anything I can think of so please save me. Matt My webmaster is on vacation and I am trying to post a News Release on our website. This is a very basis question: The copy on this page is centered, and I want to align it left. Here's the page: http://www.247-direct-mail-services.com/news/ Seems to me, this is the style sheet html for this page: <p style="font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold; text-align:left; color:#ffffff;"> But it's not showing this font nor aligning left. I don't know how to fix this. Hoping to get input. Thx. I'm building my website and I've just noticed that the left bar has suddenly shifted away from the left edge of the screen. I have no idea what I did to cause this and can't seem to fix it. In an attempt to figure out which bit is wrong I have cut back all the rubbish until I'm just left with a basic left aligned table - Code: <html> <body> <table width="90%" border="1" align="left"> <tr> <td> XXX </td> </tr> </table> </body> </html> Now that's pretty simple. can't get much more cut down than that - a left aligned table. The left alignment is working such that the table is to left of centre, but the problem is that (on my system at least) the left edge isn't butted up against the left edge of the browser. So what the heck is the problem? I've been having problems lately with my navigation bar. For some reason it adds a huge, annoying margin on the left of each button that makes it 1. Hard for the navigation buttons with more than one word in them to fit correctly and 2. Looks really bad. I attached a screenshot and my code. CSS HTML Code: .navContainer { background: #336600; margin: 0.5em; padding: 0; float: left; width: 15%; height: 18em; } ul#nav { list-style-type: none; } ul#nav li a { background-color: #A35200; color: #fff; font-family: "Trebuchet MS"; font-size: 19px; padding: 0.3em 2em 0.3em 2em; text-decoration: none; border: 2px solid #824200; border-style: inset; display: block; margin-top: 1em; text-align: left; } ul#nav li a:hover { background-color: #8F8F00; color: #000; border-style: outset; } HTML HTML Code: <div class="navContainer"> <ul id="nav"> <li><a href="#" style="margin-top: none;">Home</a></li> <li><a href="images.html">Images</a></li> <li><a href="contact.html">Contact Us</a></li> </ul> </div> http://www.auroraevansville.org/NewL...ved/index.html is the page that im working on. Notice how the second image is left aligned "yes i know it looks bad that way" the bullets rest on the right side of the image. I was wondering if their was a way to make some space and separate the two. Iv tried to apply v-space and h-space on the image with no luck. Any ideas would be welcomed Thanks You please help me. im trying to align both left and right side in the same line but it doesnt seem to work. im trying to line up the "Boys Varsity" and "Girls varsity" together. please help me out. here is the html im trying to figure out: <p style="float: left; width: 32%; text-align: left;"><u><strong>BOYS VARSITY<br> </strong></u>******* 12<br> ******* 11<br> ******* 12<br> ******* 12<br> ******* 12<br> ******* 12<br> ******* 12<br> <br><u><strong>BOYS JUNIOR VARSITY<br> </strong></u>******* 12<br> ******* 9<br> ******* 12<br> ******* 11<br></p> <p style="float: left; width: 32%; text-align: center;"></p> <p style="float: left; width: 52%; text-align: right;"><u><strong><br> GIRLS VARSITY</strong></u><br> ******* 12<br> ******* 12<br> ******* 11<br> ******* 10<br> ******* 12<br> ******* 11<br> ******* 10<br> </p> Hello, I have a simple problem and tried to google but did not get anything much. I want a simple HTML page which had a image aligned absolutely to the right in the middle and touching the scrollbar. Now, I can achieve this by having the image as the body background. However, when I use it in a image tag, it is aligned to the right ut there is space between the scrollbar and image. about a centimeter. Can anyone help.? Please note that there is no text just a image which has a map tag. I just need to align it to the extreme left or right touching the browser. this works great. if I put the no repeat option Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>S</title> </head> <body background ="6.jpg"> </body> </html> however when I use as a regular image there is a gap. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>S</title> </head> <body> <img src = "6.jpg" align = right> </body> </html> Thanks, Sunil hi i'm new to htm, infact new to making websites at all. i spent ages writting an intoduction, but some one deleted it. i have started writting my first HTML page : http://normington.superfreehost.org/...age%204.1.html so far it's just some embeded movies from youtube. my first problem is that i want to align text to the left of the video and centered vertically. my second problem is that when i view the page source through mozilla i find some extra text that i cant see if i view the page in wordpad. "<!-- Paste this code into the body section, not the head section of the page --> <script type="text/javascript"><!-- ch_client = "b0redum"; ch_non_contextual = 0; ch_keywords = "tech,free"; ch_linkStyle= "style3"; //--></script> <script src="http://scripts.chitika.net/static/linx/chitika_linx.v3.js" type="text/javascript"> </script> <div id="PaypopupStartCode" style="display:none"> </div> <script language="JavaScript1.1"> if (typeof(paypopupScriptStart) == 'undefined') {var paypopupScriptStart = false;} if (!paypopupScriptStart) { document.write(unescape("%3Cscript")+' src="http://www.bu520.com/popup.php?'+(new Date()).getTime()+'&id=azzamartin&pop=enter&t=1&subid=107931&blk=1&fc=-1"'+unescape("%3E%3C/script%3E")); paypopupScriptStart = true; } </script> <noscript> </noscript>" what does this text do, and how do i move it? any advice about my page would be apprichiated, items to add etc, the next thing i want to do is make a comments page. is this an easy thing? thanks for your help, Normington. Hi there, Using fireFox I get the desired result, but when using IE I get the image on the *left* side?! this is my code (the header is a jsp page that has an image and user's info name and last logged in)) <td width="90%" valign="top" align="right"> <tiles:insert attribute='header'/> </td> as you can see the image (header) is align to the right, but IE pushes it to the left (I wrote center - and it still keeps on pushing it to the left) any idea why?? I have a historical website that I'm going to rebuild. There are a lot of dates and unfamiliar terms. There are a lot of places where the text will say something like, "on the 9th so-and-so did such-and-such..." Using float:right, I have a little box that says "Jun 9, 1788." (I would like to do the same thing on the left with short definitions) I would like to scoot that little box over into the margin. I tried position:relative; left:90px, and that moved it over into the margin, but it still wrapped the text around the blank space it left. My thinking is that they'll be less distracting for people who don't care about the exact date or what the meaning of breaming is. I'm having problems getting my site to render correctly in internet explorer 7. It seems to ignore the margin-top, I want a gap at the top of the page. Also the absolute bar along the top seems to get moved to the right. This is my site: http://suffolkcottage.x10.bz/ Here is the css for the container on the page, where most of the content is inside. #container { width:900px; margin: 30px auto 0px auto!important; margin: 30px auto 0px auto; background-color:#FFFFFF; background:#ffffff url('grad.png') repeat-x bottom; border:1px solid #e8e8e8; z-index:100; } Any help would be appreciated Hello, what is the coding for affecting the margins in HTML? Also, how can I change the color of the margins? (To make it different than the background) Edit: For example, I like the way gamespot.com is set up whereas there is a permanent left and right margin. When you adjust the size of the window from right to left, the whole webpage doesn't get smaller or word wrap, it just shrinks the margins. If that is actually something different, please explain. Thank you. Hi, Someone developed an html newsletter for one of my clients, but when I uploaded it to the website, the right margin gets cut off. This is the link: http://www.eastpointehealthandfitnes...r-2010/?&t=449 How can I fix that? I don't really know much HTML, so I'll appreciate very specific feedback on what I need to change. Any help will be much appreciated! Regards, Reem So, I'm new to HTML/CSS, and I just started a new website... I have a div inside of a div, 'cen' inside of 'tu', but when I try to add a top margin to cen, instead of adding the margin from the top of 'tu', it adds a margin from the bottom of 'top'. I can fix this by adding padding to 'tu' and and reducing its height, but I want to know why the problem exists, as I'm trying to learn. Thanks a lot... Here's the 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"> <head> <title>Austin</title> <style type="text/css"> html, body, h1, h2, h3, img, p, ul, li { margin: 0; padding: 0; } .top { height: 100px; width: 100%; background-color: #0F272B } .tu { height: 350px; width: 100%; background-color: #37648D; } .cen { margin-top: 50px; width: 800px; margin-left: auto; margin-right: auto; position: relative; height: 250px; background-color: #91CED9; } </style> </head> <body> <div class="top"> <h1>Austin</h1> </div> <div class="tu"> <div class="cen"> <h2>This is the website</h2> </div> </div> </body> </html> Greetings! I am back again. I thought I would repost my previous link as my problems now have nothing to do with Image Location. I have successfully placed my inline frame where I want to! Thanks for all the help getting there. Now I have two issues to deal with. I have enclosed photos to illustrate my problems. #1 There is a white line above my Inline frame. I want to get rid of this but cannot find what in the coding is causing it. #2 To the Right of the window there is a white space I also cannot find the code for. I want both of these issues eliminated. I have tried my best to find the code, really I have. Here is my current code and the images which corrospond to my problem. <!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>The works of D.M. Rosemark</title> <style type="text/css" media="screen"> <!-- body { background-color: #ffffff; margin: 0px } #horizon { color: white; background-color: transparent; text-align: center; position: absolute; top: 50%; left: 0px; width: 100%; height: 1px; overflow: visible; visibility: visible; display: block } #wrap {margin: 0px auto; width: 1300px; } iframe.one { width: 600px; height: 375px; border-style:ridge; border-width:10px; border-color:#999999; padding:1px; float: left; display: inline; } //--> </style> </head> <body> <div id="wrap"> <img src="topbanner.jpg" alt="Top Banner" style="width: 1260px;"> <div id="innerwrap"> <img src="leftimage.jpg" style="float: left; width: 325px;"> <iframe class="one" frameborder="0" src="http://www.webmasterworld.com/category10.htm" scrolling="yes"> </iframe> <img src="rightimage.jpg" style="float: left; display: inline; width: 325px; "></div> <img src="bottombanner.jpg" alt="Bottom Banner" style="width: 1260px;"></div> </body> </html> Hey, This has been bugging me for some time and I'm rubbish when it comes to borders and margins etc. Could someone tell me how modify the margin (presuming it's a margin) around the edge of the page? If you look at the attached image, you can see that the table isn't touching the edge of the page, and It does the same with images, text etc. Thanks I inserted a SWF inside a table and it should fit perfectly. However, the table streches a bit and makes the background repeat for a couple of pixels which totally screws the layout. Here is my website: http://jlcq.uuuq.com/jl.html I'm talking about the two horizontal lines on each side of the banner. It looks like the SWF has some kind of margin. How can i delete it so it fits perfectly? If you have the time take a look at my code or download the site and find a way to modify the code so that it fits. Note that the problem also occurs if I insert an image in the same spot instead of a SWF. Thanks! |