HTML

Topic: CSS

How To Specify Borders of a Block Element?

CSS offers 12 style properties to control borders of a block element with 3 properties on each side to control border style, width and color. You can specify those 12 border properties in different ways as shown in the following CSS examples:    {border-width-top: 30px} - Specifies the top border width to 30 pixels.    {border-width-right: 10px} - Specifies the right border width to 10 pixels.    {border-width-bottom: 40px} - Specifies the bottom border width to 40 pixels.    {border-width-left: 20px} - Specifies the left border width to 20 pixels.    {border-width: 30px 10px 40px 20px} - Specifies the border widths on 4 sides: top, right, bottom and left.    {border-style: solid dotted double dashed} - Specifies the border styles on 4 sides: top, right, bottom and left.    {border-color: #ff0000 #00ff00 #0000ff #000000} - Specifies the border colors on 4 sides: top, right, bottom and left.    {border-top: 30px solid #ff0000} - Specifies border width, style and color on the top side.    {border-right: 10px dotted #00ff00} - Specifies border width, style and color on the right side.    {border-top: 40px double #0000ff} - Specifies border width, style and color on the bottom side.    {border-top: 20px dashed #000000} - Specifies border width, style and color on the top side.    {border: 20px dashed #000000} - Specifies border width, style and color on all 4 sides with the same values.When borders are specified, the size of the content box will be reduced to give room to meet the specified border widths on 4 sides. The size of the content box can be calculated as:Content width = "width" - "padding-left" - "padding-right"  - "border-left-width" - "border-right-width"  Content height = "height" - "padding-top" - "padding-bottom"  - "border-top-width" - "border-bottom-width"

Browse random answers:

What Is an Inline Element?
Hot To Specify Padding Spaces of a Block Element?
How To Specify Borders of a Block Element?
How To Specify Margin Spaces of a Block Element?
How To Specify the Color of the Margin Area?
How To Specify the Color of the Padding Area?
What Are the Background Properties of a Block Element?
How In-line Elements Affect Line Box Heights?
How Many Ways Can Elements Relate to Each Other?
Why Is the Top Margin Not Showing?
How Is the Width of a Parent Element Related to Child Elements?
How Is the Full Width of a Block Element Extended?
What Are White Spaces in HTML Documents?
What is CSS?
Describe features of CSS? 
Describe the rules in style sheets? 
Describe hover element? 
Give some uses of CSS?
What are Cascading Style Sheets? 
What are the various style sheets?
What are style sheet properties? 
List various font attributes used in style sheet. 
If background and color should always be set together, why do they exist as separate properties? 
What is class? 
What is grouping ?
What is external Style Sheet? How to link? 
Is CSS case sensitive? 
What is ID selector? 
Why do style sheets exist?
 What is inline style? How to link? 
What is imported Style Sheet? How to link? 
How To Store CSS Definitions in External Files?
What is alternate Style Sheet? How to link? 
What is attribute selector?
Explain inline, embedded and external style sheets .
What are the values of "Position" attribute in CSS?
What is the default value of "position" attribute in css?
Can you specify more than one css class for any HTML element?
What is the difference between specifying css class with # and .? i.e. #Class1 or .Class1?
What are the advantages/disadvantages of the various style methods?
Explain inline, embedded and external style sheets.
What is CLASS selector?
What is CSS declaration? 
What is 'important' declaration?
What is property?
Can I include comments in my Style Sheet?
What is the difference between ID and CLASS?
What is value?
What is initial value? 
How To Style Table Cells?
How To Style Forms?
Can I attach more than one declaration to a selector?
What is the percentage value in 'font-size' relative to?
How do I centre my page?
‘Fixed’ Background?
What is embedded style? How to link?
What is contextual selector?
How do I have a background image that isn’t tiled?
Why do style sheets exist?
What is imported Style Sheet? How to link?
What is a Style Sheet?
How to write conditional statement in CSS?
How to write styles for all html elements of the same type?
What are the possible values of the "Position" attributes?
How to display a link without underline and display underline when mouseover on the link using CSS?
How to float the image left side and let the page content fill right side and bottom in CSS?
How to line break in CSS?
How to page break after an html element in CSS?
State some limitations of style sheets?
How do I center block-elements with CSS1?
What are the values of "Position" attribute in CSS?
What is the default value of "position" attribute in css?
display and visibility properties are used to hide and show elements in any page. Then how they are different from each other?
Can you specify more than one css class for any HTML element?
What is CSS rule 'ruleset'?
How to make a Arabic style (right to left direction) web page with css?.
What is Tweening ?
Can CSS be used with other than HTML documents? 
Can Style Sheets and HTML stylistic elements be used in the same document? 
How do I design for backward compatibility using Style Sheets? 
What is CSS declaration? 
What is ‘important’ declaration?
What is cascade? 
How do I have a non-tiling (non-repeating) background image?
Styles not showing?
How do I quote font names in quoted values of the style attribute? 
What is property?
How do you make a whole div into a link?
What is shorthand property?
How To Style Forms?
Can I attach more than one declaration to a selector?
How do you target a certain browser?
What is the percentage value in ‘font-size’ relative to?
Do URL’s have quotes or not?
How do you show which page you’re on (in a menu)?
Document Style Semantics and Specification Language (DSSSL)?
How To Style Table Cells?
How To Style Forms?
In what order do CSS style definitions take priority?
How can we write margin and padding format in css code?