Border Surronding Body (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets and Accessibility



Message


jengoggtim -> Border Surronding Body (12/16/2008 19:32:30)

I'm using a template with a css style sheet. I'd like to create a thin black border around the entire body. If I insert the following into the body section of the style sheet will it work? Thanks!

{border-width: 1px;
border-style: solid;
border-color: #000000;}




d a v e -> RE: Border Surronding Body (12/16/2008 22:57:05)

try it and see :)




coreybryant -> RE: Border Surronding Body (12/17/2008 10:07:29)

I agree with Dave about trying it :) - but what about the selector?

And you should try shorthand - sometimes it is better:
{border: solid 1px #000}

You will be saving about 40 bytes - not much, but every little bit helps.




jengoggtim -> RE: Border Surronding Body (12/17/2008 13:53:25)

I tried inserting the above code and I got a black border around the background surronding my page. How can I exclude the background (I don't know if that is the correct terminology) so that the border is only around the body?

I'm not sure what "selector" means. I searched briefly online but didn't get a clear picture.

Can the short hand code version be mixed with existing code? I tried following the existing format because that's all I'm familiar with.

I agree about trying. I'm just hesitant about experimenting with a site that generates most of my income. I've made some changes in the past and had trouble undoing them. But, I realize that change is necessary in order to remain competitive so I try to make improvements when I can.




Tailslide -> RE: Border Surronding Body (12/17/2008 15:33:07)

Isn't the background on the body element? That'd be the normal thing... Not sure what you mean by exclude the background - that is the body element...

Can you give us a link and we'll have a look for you.




coreybryant -> RE: Border Surronding Body (12/17/2008 15:59:10)

All you need to do is create a test page - and upload it. That is the easiest and best way to test without affecting your main site. I bet a lot of us have a lot of "test pages" in our website.

The selector could be the body, so you have
<style type="text/css">
body
{
	border: solid 1px #000
}
</style>

Take a look at this example.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625