HTML - Div Margin Changes When Nest Div Maring Is Changed
Hello, I am having this problem with this one div that is nested within another one. I am trying to adjust the the nested divs margin, but the problem I am having is when I change the margins of it, then it changes the margin of the div that it is in. I am not sure why I am having this problem.
Here is the page http://www.mesquitechristmas.com/development/ The code in question is below. If I adjust the margins of welcome and reservations then it also changes the content divs margin. How can I fix that content div so the maring doesn't change when I change the divs nested inside it? Code: <div id="content"> <div class="welcome"> <img src="images/welcome.gif" alt="Welcome To Texas Camping Forum" style="margin-top: 3px;"> <p> Coming Soon, a new and improved Texas Camping Forum for Fall 2008!!!<br> Bookmark us and check back often....</p> </div> <div class="reservations"> <img src="images/reservations.gif" alt="Make Reservations" style="margin-top: 3px;"> <p> Texas Parks & Wildlife Dept. uses Reservation America as their choice for making reservations online.</p> </div> </div> Code: #content { margin:5px 0 0 140px; width: 630px; border-left: 1px solid #F4F4F4; } .welcome { margin: 20px 0 0 20px; width: 600px; text-align: center; background: #f5f6ea; border: 1px solid #b3b58d; } .reservations { margin: 10px 0 0 20px; padding: 5px; width: 300px; background: #f5f6ea; border: 1px solid #b3b58d; } -Thanks 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 hello, something has went wrong with a site i done years ago! the background was fixed in the middle and stayed put while everything else moved over it. now for some reason it had became tiled and is scrolling with everything! if any one can help that would be awesome! here is the code... <style> { } table, tr, td { background-color:transparent; Center; background-attachment:fixed; background-repeat:no-repeat; border-color:EECC22; border-width:0px; border-style:Solid; } table table { border:0px; } table table table table { border:0px; background-image:none; background-color:transparent; } table border:none; border-width:0px; } table table table { width:90%; max-width: 600px; } table table table table { width:100%;; } body { background-color:00002C; background-image:url(http://i72.photobucket.com/albums/i1...ysSquare.jpg); background-position:Top table table { border-style:Groove; border-width:2px; border-color:0000FF; background-repeat:no-repeat; background-attachment:fixed; } table table table td { background-color:00005F; } table, tr, td, li, p, div { color:0000FF; font-size:8pt; } .btext { color:0000FF; font-size:8pt; } .blacktext10 { color:0000FF; font-size:8pt; } .blacktext12 { color:0000FF; font-size:8pt; } .lightbluetext8 { color:0000FF; font-size:8pt; } .orangetext15 { color:0000FF; font-size:10pt; font-family:Mv Boli; } .redtext { color:0000FF; font-size:8pt; } .redbtext { color:0000FF; font-size:8pt; } .text { color:0000FF; font-size:8pt; font-weight:bold; } .whitetext12 { color:0000FF; font-size:8pt; } a:active, a:visited, a:link, a.searchlinksmall:active, a.searchlinksmall:visited, a.searchlinksmall:link { color:0000FF; font-size:8pt; } a:hover, a.searchlinksmall:hover { color:0000FF; font-weight:bold; text-decoration:underline; } a.navbar:active, a.navbar:visited, a.navbar:link { color:0000FF; } a.navbar:hover { color:0000FF; text-decoration:underline; } a.redlink:active, a.redlink:visited, a.redlink:link { color:0000FF; } a.redlink:hover { color:0000FF; text-decoration:underline; } .nametext { color:0000FF; font-size:8pt; } .contactTable { width:300px!important; height:150px!important; padding:0px!important; background-image:url(http://img5.pimp-my-profile.com/i1/9...d5b02397.png); background-attachment:scroll; background-position:center center; background-repeat:no-repeat; background-color:transparent;}.contactTable table, table.contactTable td {padding:0px !important; border:0px; background-color:transparent; background-image:none;}.contactTable a img {visibility:hidden; border:0px!important;}.contactTable a {display:block; height:28px; width:115px;background-color:transparent!important;}.contactTable .text {font-size:1px!important;}.contactTable .text, .contactTable a, .contactTable img {filter:none!important;background-color:none!important;} .contactTable. whitetext12 {display:none;; } table td div div font {visibility:hidden;} </style> <p align="center"><a></a><br /><a href="" target="_blank"></a> <a href="" target="_blank"></a> <a href="http://www.msplinks.com/MDFodHRwOi8vd3d3LnBpY29vZGxlLmNvbS8=" target="_blank"></a></p> We are Solarize a rock/metal/electro quartet from sunny Strathaven. We've spent a lot of time writing, recording and playing shows and finally have an album brewing up! We are back in the writing process to begin 2008 with one demo from new CD 'The 4th law of motion' already on tinternet and more still to be written/finished. We feel we've came a long way from playing 'remember when' in 05 to where we are today. Do come along to some shows and have a listen to whatever you can find online! <br /> <br /> <br /> **Here at solarize we are greatfull for any imput and will love you forever if you add us!<br /> <p align="center"><br /><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="80" width="375" align="middle"> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value="http://www.poqbum.com/add/shock1.swf" /> <param name="wmode" value="transparent" /> <param name="quality" value="high" /> <param name="flashvars" value="texter=Solarize" /> <param name="bgcolor" value="000000" /> <embed type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" src="http://www.poqbum.com/add/shock1.swf" height="80" width="375" align="middle" wmode="transparent" quality="high" flashvars="texter=Solarize" bgcolor="000000" /> </object><br /><a href="target=" target="_blank"><small></small></a><br /></p> <br /> <style>td.text td.text td td a, .redlink, td.text td.text td b a {visibility:visible!important;} td.text td.text td a {visibility:hidden;}</style> <a href="target=" target="_blank"></a> <style> td.text td.text table table table td a img {width:100px;} td.text td.text table table table td div img {width:80px;} td.text td.text table table td img {width:260px; max-width:260px; width:auto;} td.text td.text table table td div img {width:80px;} * html td.text td.text table table td img {width:260px;} * html td.text td.text table table td a img {width:90px;} * html td.text td.text table table td div img {width:80px;} </style> <a href="" target="_blank"></a> In my website a sample of my request and it shows how far I have gotten. Go to: www.openoursite.com and select keyword: CHRYSLER Here you will see a picture of my Red 1961 Chrysler 300. By the way, it is nearly perfect as well as beautiful. Below the picture is a button that when clicked, the picture changes to the next picture in the series of pictures. I want to beable to change the bulleted text when the picture changes. 2nd, I want the text at the bottom of the screen to beable to be changed. 3rd, I would like to beable to have a switch in the code that I can set so that only 1 of the two text areas will change and the other stay as is. On a car application, I would leave the bulleted text as is and only change the text below. Probably there should be 2 seperate switches that can be turned off or on. I have one customer (advertiser) that wants the bulleted text to change and have no text at the bottom. Can anyone help me. Thanks Launchnet I'm utterly confused. Within my heavily "modded" phpBB2 forum, at the top is our Logo, which is a gif image of 800 x 150 in size. Always has been that size since last year (apart from a change in the logo itself). Now, up to a couple of days ago, the Logo displayed correct ratio in ALL browsers. But for some extreme strange reason, the image is now reduced from 800 to 720 in Firefox!! None of the css has been altered, not the overall_header.tpl file, not has any configurations for the Firefox browser been messed about with either. Section from overall_header.tpl file... Code: <table cellspacing="0" width="100%" id="forum"> <tr> <td class="forum-header" align="center"><a href="{U_INDEX}" title="{L_INDEX}"><img src="templates/ca_aphrodite/images/sblogoyg3.gif" width="800" height="150" alt="{L_INDEX}" /></a></td> <td class="forum-header header-search" align="right" valign="bottom"> </td> </tr> <tr> section from css.... Code: /* header */ .forum-header { background: #F7F7F7 url(images/bg_logo.gif) top left repeat-x; padding: 0; } All the above does in places a line wih gradiant behind the logo. To get an overall idea, see my website: http://www.screwballscrabble.co.uk Anyone got any ideas why Firefox is not displaying images at the original size? Any pointers would be extremely grateful! Thanks. OK, I have an expandable menu that, when someone clicks on an image, it takes them to a certain page. The code is currently: HTML Code: p = new createPanel('al','Account Info'); p.addButton('images/menu/story.jpg','Story','parent.main.location="background.php"'); o.addPanel(p); I have about 12 of these links, and all the others in the menu work fine. With this particular one, I changed the "parent.main.location" At first, the line was 'parent.main.location="story.php"'); but I decided to change it. I've uploaded all the changes, and yet this link STILL accesses 'story.php' instead of 'background.php' like it is supposed to. This is the best part: I deleted the page 'story.php' off my server. Even after me doing that, the link continues to call up that page. I have cleared my cache, cookies and Firefox's "personal data" collection. Also, there are no other pages on my site that even look like 'story.php'. Anyone know why a line of code specifically calling for a different page would keep pulling up an old page - especially a page that has been deleted? Thanks a ton, Aaron I have a website and of course I have my index.html in my documents. Well today I was doing something in Notepad that had nothing to do with html and saved it as text file. Now the Blue E icon for my index.html has changed. I can still open it by choosing open with Internet Explorer. This is driving me nuts does anyone know how to get the Icon back. I am running WindowsXP. I do hope my post is clearer than mud is Hi Guys. I recently updated my website, I moved my company logo so it would be above my main navigation, however by doing this I needed to change the .css slightly (the "Stage" width was altered - this was the only thing I changed). By doing this it allowed for a slightly newer navigation layout which you can view HERE. However since I have done this, the website is no longer viewable properly using a Mac (it still looks fine on a PC) why would this have changed? (I took a screen grab of what I mean - you can view it HERE I'm not a pro by any means, I have self taught myself but I am seriously stumped by this. Any help is welcome! 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 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. 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. 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 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> I am having a problem that I can not figure out why this is happening. I have two divs one named content and one named welcome. The welcome div is nested inside the content div. Whenever I change the margin top for the welcome div it also changes the margin top of the content div it is nested in. How can I keep it where the content div is fixed and doesn't move no matter where I set the margin top for the welcome div? Here is the HTML.... Code: <div id="content"> <div class="welcome"> <p> Coming Soon, a new and improved Texas Camping Forum for Fall 2008!!!<br> Bookmark us and check back often....</p> </div> </div> Here is the CSS... Code: #content { margin: 5px 0 0 140px; text-align: center; width: 630px; border-left: 1px solid #F4F4F4; } .welcome { margin-top: 25px; } Here is the link to the site.... http://development.mesquitechristmas.com/index.html Any ideas or suggestions as why this is happening? -Thanks Hey guys, First post. Glad to see such an active forum. Can someone check out http://www.karmasfortune.com/ohiopainclinic/ I'm trying to get rid of the top margin between the very top and the div.. so that I can utilize the top portion of the background image as a menu system. I tried putting the top-margin: 0px in my div container, but it won't budge. Thanks in advance.. 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! Hey so I guess there are going to be quite a few groans from some people, but I need help with the HTML Coding on my band's MySpace... I am rubbish at this whole code business so I bow down to anyone who can help me with a few things... Firstly, take a look at the page... www.myspace.com/sevendayslater OK, I've got it looking almost how I want it, but there are a few things that are annoying the hell out of me... 1) The band logo is kind of right-aligned... the code says it is "left" but it looks weird.. 2) I want the music player / gig listing / blog entry to be in line with where it says Biography... 3) The mailing list thingy, does anyone know how to make it the same size as everything else in it's column?? Also can the background be black and not transparent?? If anyone can help I would hugely appreciative!?! OK guys I'm having a 'no brain day'. Could someone please take a look at http://www.telfordsteamrailway.co.uk...ture/usage.php Near the bottom is a yellow box. - why is there a yellow border / margin under the image? heres the code - which validates Code: <div style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border:0px; background-color:yellow;"> <img style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border: 0px; background-color: green;" src="http://www.meteogroup.co.uk/meteo/hptool/logo_meteogroup.png" alt="" width="120px" height="32px" /> </div> I havent got much hair left to tear out. Allan 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> |