School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,372 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,471 people online right now. Registration is fast and FREE... Join Now!




css/DIV/Style & Borders

 
Reply to this topicStart new topic

> css/DIV/Style & Borders

no2pencil
Group Icon



post 22 Apr, 2008 - 09:39 PM
Post #1


css/DIV/Style & Borders:

Using standard HTML, your choice for border is limited, & can be pretty boring! You can change the color, the thickness, & that is about it.
However, with the use of stylesheets, you have much more of a variety of borders to implement onto your webpage.

There are three css settings you can change on your borders:

border-width
border-color
border-style

Most of the time you will only affect these attributes with 1 simple reference to the border attribute, however it is worth noting you can set these attributes individually.
As well, you will override anything that you have previously defined in a stylesheet since there is no order rule for these attributes.

Here's an example:

CODE

<div style="border: 3px coral solid;">text</div>


To affect specific sides, use the following attributes:

CODE

border-top
border-left
border-bottom
border-right


Using these you can force individual borders to display differently, or not at all.

CODE

<div style="border: red 4px dashed; border-bottom: blue 4px solid; border-top-style: ridge;">text</div>


border-width
This value can be assigned in pixels or you can use one of the three standard values thin, medium and thick.

CODE

border-width: thin;

border-width: medium;

border-width: thick;


border-style
This value allows you to adjust how your borders are presented. There are a total of eight possible styles you can choose from:

CODE

border-style: solid;

border-style: dashed;

border-style: dotted;

border-style: double;

border-style: groove;

border-style: ridge;

border-style: inset;

border-style: outset;


Lastly, one that should be familiar to you...

border-color
You can color your borders using either HEX codes or named colors.

CODE

border-color: black;

border-color: 000000;
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/7/09 09:13PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month