CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 25th, 2006, 04:19 AM
ratsche ratsche is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 6 ratsche User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 30 m 45 sec
Reputation Power: 0
Shorter border, is it possible?

Hiho,
I want to style my heading with a top and bottom boarder. A simple solid one works pretty fine. But I like to have one that is padden padded at the left and at the right. Is there a way to do it?

Here is my code:
Code:
 
#content1 h2 
{   padding-left: 10px;
    padding-right: 10px;
    clear:both;
    position: inherit;
    color: #86BDF5;
    border-top: solid 3px #336699;
    border-bottom: solid 3px #336699;
    font-size:1.2em;
    font-family: Lucida sans, Verdana, sans-serif;
}


I just want the the border to be padded also. ...i searched a lot, but i find no solution.

greetz,
ratsche

Reply With Quote
  #2  
Old May 25th, 2006, 05:35 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 3,009 Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Days 17 h 35 m 11 sec
Reputation Power: 1223
If I've understood you correct you want to use margin instead of left and right padding.


Code:
 
#content1 h2 
{   margin-left: 10px;
    margin-right: 10px;
    clear:both;
    position: inherit;
    color: #86BDF5;
    border-top: solid 3px #336699;
    border-bottom: solid 3px #336699;
    font-size:1.2em;
    font-family: Lucida sans, Verdana, sans-serif;
}



If you look at the box model, you can see that the border is outside of the padding but within the margins of an element.
http://www.w3.org/TR/CSS21/box.html#box-dimensions
__________________

Reply With Quote
  #3  
Old May 25th, 2006, 06:13 AM
Grafmix's Avatar
Grafmix Grafmix is offline
Anal Purist
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Bob's Auto Parts...
Posts: 830 Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level)Grafmix User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Weeks 15 h 24 m 53 sec
Reputation Power: 79
I think ratsche wants something like this:
Code:
  ------
THE HEADER
  ------

Though, I haven't given it enough thought to come up with a solution yet.

The trouble is, it defies the nature of the box model - there'll need to be some dark CSS witchery involved
__________________
We are troll foldy-rolls and we'll eat you for our supper.

Last edited by Grafmix : May 25th, 2006 at 06:16 AM.

Reply With Quote
  #4  
Old May 25th, 2006, 07:05 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 10,180 ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 5 Days 19 h 54 m 23 sec
Reputation Power: 2037
How bout something like:
Code:
<style type="text/CSS">
#content1 h2 
{
	display:inline;
	margin:0px 10px 0px 10px;
	position: inherit;
	color: #86BDF5;
	border-top: solid 3px #336699;
	border-bottom: solid 3px #336699;
	font-size:1.2em;
	font-family: Lucida sans, Verdana, sans-serif;
}
#content1 h2 span
{
	margin:0px -10px 0px -10px;
}
</style>
</head>

<body>
<div id="content1">
	<h2><span>The Header</span></h2>
	<p>Lorem ispum..</p>
</div>
</body>
</html>
?
Comments on this post
Grafmix agrees: Ruddy bloody nice one!
kk5st agrees: Rats! You always grab the easy ones. Nice hack.
__________________
Support requests via PM will be ignored!
Sites: WordPress Metro Theme | Route of Queue
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question


Reply With Quote
  #5  
Old May 30th, 2006, 04:10 AM
ratsche ratsche is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 6 ratsche User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 30 m 45 sec
Reputation Power: 0
thx a lot! that's what I'm looking for!
...looks easy, if you know how to do it

greetz,
ratsche

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Shorter border, is it possible?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap