Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » Possible to assign a "margin" to any element?
Uniqs:
150
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Getting Wordpress and phpBB to work together »
« Network Solutions holding domains hostage?  

Sentinel
Premium
join:2001-02-07
Florida

Possible to assign a "margin" to any element?

I just want to draw a simple line across a web page. Sounds easy but I am finding it to be very very hard.
So far I am using a simple hr tag. I do the following..

hr color="blue" noshade width="100%" size="10" />

...and I tried...

hr style="color:blue; background-color:blue; width:100%; height:10px; border:none;" />

They both work great except that they don't go ALL the way across the page. They leave a margin on each end of the page due to the body margins of the page. I can of course define no margins for the body and that works great except that then my entire web page has no margins.

So what I would like to do is to be able to define no margins for just the line alone and not effect the rest of the page. Is this possible? I tried using a margin variable on the hr tag in the style but it did not work.
Kiwi
Premium
join:2003-05-26
USA

2 edits

Re: Possible to assign a "margin" to any element?

You are not 'Opening' " with less than but ending correctly with />

Sentinel
Premium
join:2001-02-07
Florida

Re: Possible to assign a "margin" to any element?

Do you mean what I wrote above? Yeah, I did that on purpose so that the post doesn't show the html. On the actual web page of course I had the "" opening brace or else nothing would have worked at all.

Sorry. I assumed that the post itself showed enough knowledge of html that anyone reading it would assume that I knew enough to make a correct tag. I should have noted that I was purposefully leaving out the first brace so that the html would not render here. My apologies if it through you off.

Do you have a solution to my problem though?

Gwellin
Premium
join:2004-05-31
Regina, SK
·Access Communicati..

Re: Possible to assign a "margin" to any element?

Try using the [code][/code] pseudo-tags that most forums offer you. You could also enter it directly but replace the angle brackets with their meta-character equivalent; for example I can display angle brackets < > by entering this: &lt; &gt;

That combined with some previewing to make sure you got it right will give a more understanding post.

-

Anyways, about the horizontal rules you were trying to make. You can easily use negative margins in this case for your rule; make them equal to the body margins and that should be it.

Assuming a body margin of 10px.

Also, horizontal rules are block elements, so you don't have to defined the width at all. In fact you shouldn't to prevent possible cross-browser incompatibilities.

--
Here to help all those in need, whenever I can.

Sentinel
Premium
join:2001-02-07
Florida

Re: Possible to assign a "margin" to any element?

That did the trick. Thanks Gwellin. Much appreciated.
Forums » Tech and Talk » OS and Software » Webmasters and DevelopersGetting Wordpress and phpBB to work together »
« Network Solutions holding domains hostage?  


Saturday, 05-Dec 12:36:16 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [163] Comcast Releasing Promised Usage Meter
· [145] Avast Antivirus Has Gone Mad
· [126] Comcast Makes NBC Universal Acquisition Official
· [104] Graduate Student Unveils Sprint's GPS Sharing With Feds
· [101] Google Invades ISP, OpenDNS Turf With Google Public DNS
· [95] The Bandwidth Hog Does Not Exist
· [84] FCC Ponders Moving From PSTN To IP Voice
· [81] Latest Consumer Reports Survey Not Kind To AT&T
· [79] New Bill Aims To Limit ETFs
· [74] Sprint Defuses GPS Privacy Media Bomb
Most people now reading
· False positive in Avast! or is it real? [Security]
· Wife might have to work in.... Iowa for a few months!!! [General Questions]
· Windows 7 boot manager editing questions [Microsoft Help]
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· Can I put insulation behind wires from panel? [Home Repair & Improvement]
· First commercial tool to crack BitLocker arrives (Updated) [Security]
· UPS - What do you people think happened? [General Questions]
· Road Runnner up to 50 mbps is ready ! [Road Runner]
· What is the spell hit cap for a lvl 80 full arcane spec mage [World of Warcraft]
· Farewell [Bell Canada]