HTML - How To Put A Margin On Horizontal Rule In Html?
Is there a way in plain old HTML (not CSS) to place a margin around a <hr>?
I'm somewhat new to HTML, and have searched all over, and can't find how to do this Similar TutorialsWith the "horizontal rule", is it possible to write over it? The reason I am asking is because I saw an example of a horizontal rule, and it reminded me of a footer. Are they used for footers if some cases? Cheers guys (and I apoligize for all the questions). Hi, hope someone can help. For some reason I can't seem to get a horizontal rule to show in my website and I can't for the life of me understand why ! Could someone advise me please. My code is below. I'm not sure if it's something to do with css. PHP 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" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Back Garden Moths</title> <meta name="keywords" content="moths,garden,uk,british,British,large,butterflies,recording,light,sugar,moth group,back garden,wildlife,traps,actinic,uk moths,moth species,macro moths"/> <meta name="description" content="Few people realise the wide spectrum of moth species which often rival the beauty of butterflies. Some even consider the moth to be the pinnacle of the insect world. This site includes information on the techniques involved in moth recording and aims to encourage others to discover the diversity of the moth world hidden in their own back garden."/> <link href="default5.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="logo"> <h2><a href="http://www.back-garden-moths.co.uk/"></a></h2> </div> <div id="page"> <ul id="tabmenu"> <li><a class="active" href="index.php">Home</a></li> <li><a href="Databaseintro.php">Species search</a></li> <li><a href="recordsmain.php">Members records</a></li> <li><a href="forum/gallery/menu.php">Gallery</a></li> <li><a href="tab3.html">Thumbnail index</a></li> <li><a href="monthid.php?flightID=<?php echo date( 'F', time() ); ?>">What's flying this month?</a></li> <li><a href="Sightings.php">Sightings</a></li> <li><a href="Links.htm">Useful Links</a></li> </ul> <div id="navbar"> <li><a href="tab2.html">Forum Index</a></li> <hr/> <br /> </div> <img src="Images/Lob.jpg" alt="Zeiraphera isertana" width="400" class="left" /> <h2 class="title">Back Garden Moths - the community moth site...</h2> <p>For many people, encounters with moths revolve around unwanted intrusions into their homes. </p> <p> Few people realise the wide spectrum of moth species which often rival the beauty of butterflies. Some even consider the moth to be the pinnacle of the insect world. This site includes information on the techniques involved in moth recording and aims to encourage others to discover the diversity of the moth world hidden in their own back garden. </p> <h3>Come and take part</h3> <p>There are a number of ways in which you can contribute to the site and extend your own knowledge in this area. A comprehensive <a href="forum/index.php">forum</a> is available if you have any questions, comments or would like to chat to other wildlife enthusiasts. So come along and join. The <a href="Sightings.php">sightings</a> section enables you to post sightings of any interesting moths or butterflies you have seen in and around your garden. And finally there's the <a href="recordsmain.php">members records</a> section which allows you to post all your records in your own personal database. Your records can be searched to keep a track on the number and variety of species recorded, plus a variety of other statistics are available. Data entered is also combined to give a running commentary on the types of moths flying across the UK.</p> <p> </p> </div> <!-- end page --> <div id="footer"> <p id="legal">© Simon Wantling 2008 </p> <p id="links"><a href="http://www.statcounter.com/" target="_blank"><img class="statcounter" src="http://c2.statcounter.com/335444/0//0/" alt="website stats" ></a></p> </div> <!-- Start of StatCounter Code --> <script type="text/javascript"> var sc_project=335444; var sc_invisible=0; var sc_partition=1; var sc_security=""; </script> </body> </html> I am currently creating some code containing a horizontal rule, some headers and a link that takes the user back to the top of the page. The page should look something like this... ------------------------------------------------------- HEADER ------------------------------------------------------- back to top HEADER How can I make it so that the header is the same distance from the horizontal rule regardless of whether the back to top link is present? At the moment whenever the 'back to top' link is present the header below is pushed down. Here is my code so far... Code: <style type="text/css"> a{ margin-left:700px; } h2{ margin-top:20px; } </style> <hr> <h2>HEADER</h2> <p>Paragraph here</p> <hr> <a href="#top">back to top</a> <h2>HEADER</h2> <p>Paragraph here</p> the problem - Inbetween the nav bar and the body pic there is a gap! Iv tryed puting "style="margin:0px; padding: 0px;" on everything, and no succes please post suggestions here oh! and im using server side scripting to include the header and footer, in the source it is commented were it begins and ends. also in fire fox the gap is much bigger the site - http://weddingspace.awardspace.com/ Thanks ~Oblivian How can I draw an html table without horizontal cell borders? Hi all, I'd really appreciate some help on this one. I have a program which outputs very long strings of text to a HTML page. At the moment the text stays on one line resulting in an annoying horizontal scrollbar. How do I get the page to automatically format the text so that it all fits within a standard width, and so there's no horizontal scrollbar? Regards, Ruth Hi guys, got a question about a html issue. ill explain the situation, 2 persons publish htm files, this is automated, each html files is unique, so lets say person one creates indexa.htm and person two creates indexb.htm I need a general index who refer to either indexa or indexb, with the rule that it should pick the latest one changed or the newest one. Is this possible in pure html ?? Thanks in advance, Nim. Hi, 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 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 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. 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 want to embed a video player to an html page. The problem is that I want to player to butt all the way up to the top of the page what code should i google? YELP! <HTML> <HEAD><TITLE>This is your title.</TITLE> </HEAD><BODY><embed src="http://blip.tv/play/hMB_ApvuBg" type="application/x-shockwave-flash" width="590" height="360" allowscriptaccess="always" allowfullscreen="true"></embed> </a> thanks in advance. D.M. Rosemark 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 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 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.. So I have a simple question about margins, say I have this code: HTML Code: <div id="content"> <div id="content_item"> </div> <div id="content_item"> </div> </div> with this css: Code: #content{ width: 770px; height: 100%; background-color: green; } #content_item{ margin: 50px 35px 50px 35px; width: 700px; height: 250px; } now my first content Item, instead of stretching the content div up the margin, pushes the header div on top of the content div up the amount of the top margin starting from the top of the content div, leaving a large empty space. Is there some way to make that work without using padding? edit-- Ok so I've set the top padding of the content div to 30px and got rid of the margin, that gives me a nice buffer between my header on top of the content div, namely the content_item div's margin pushes the padding up now. This is giving me the effect I wanted, if anyone would still like to help me I would like to know if this is on the right track code wise. Good code, bad code, I'm still a little html green. new css: #content{ padding: 30px 0px 0px 0px; width: 770px; height: 100%; background-color: green; } |