answersLogoWhite

0


Best Answer

In CSS syntax, you can control the display of a border through many different properties depending on your needs. Properties that control the border include: border, border-top, border-right, border-bottom, border-left, border-style, border-color, border-width, border-top-color, border-top-style, border-top-width, border-right-color, border-right-style, border-right-width, border-bottom-color, border-bottom-style, border-bottom-width, border-left-color, border-left-style, and border-left-width. With these numerous properties you can control each side of the border differently. The properties of border, border-width, border-style, border-color, border-top, border-right, border-bottom, and border-left are all shorthand properties in that you can specify multiple declarations in one property as opposed to setting each individual property separately.

Let's say you were wanting to put a 1 pixel, blue topaz, dashed border around all paragraphs. In your style sheet you would do:

p { border: 1px dashed #0198E1; }

That's the shorthand way to do it, which is the more common way. The following would result in the same thing but takes up more space then the above single declaration.

p {

border-top-color: #0198E1;

border-top-width: 1px;

border-top-style: dashed;

border-right-color: #0198E1;

border-right-width: 1px;

border-right-style: dashed;

border-bottom-color: #0198E1;

border-bottom-width: 1px;

border-bottom-style: dashed;

border-left-color: #0198E1;

border-left-width: 1px;

border-left-style: dashed;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

It's really easy, the attribute takes three values: how fat the border is, what style the border is and the color of it. Here is an example code:

<html>

<head>

<style type="text/css">

img {border: 2px solid red;}

</style>

</head>

<body>

<img src="pencil.png">

</body>

</html>

And that will give you a solid red border that is 2pixels thick around your image. Hope this helps :)

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you display a border in a CSS syntax?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is the colon a valid example of CSS syntax?

No, a single colon in itself is not a valid example of CSS syntax.


A font-size 12px padding 2px margin 5px border 1px dotted yellow display block What does the 'a' in CSS mean?

"a" defines the html anchor tag (&lt;a&gt;), it is used to create links. "a" is used in css to style the link.


How can one amend border properties in CSS?

It is possible to amend border properties in CSS by understanding the border-syle value codes, border width codes, shorthand codes and border color codes.


How do you display a border like this in css The top border equals 10 pixels The bottom border equals 5 pixels The left border equals 20 pixels The right border equals 1pixel?

div.bordered { border-top:10px solid black; border-bottom:5px solid black; border-left:20px solid black; border-right:1px solid black; }


What does it mean to incorrectly render CSS?

When CSS is not compliant with set standards that are applicable, different browsers applying styles to a document with that CSS can display totally different styles, or display styles that are unnexpected or far-fetched -- this is also called "Incorrect Rendering."


Why does a css class not work in fire fox?

CSS classes do work in FireFox. What is the main problem? (specifically)Have you checked that the syntax is correct?There is a lot to learn about things with CSS and browsers, you may need a hack or fix, if all else fails.


How do you make border line in html?

You can't make border lines with HTML - you use CSS. &lt;div id="mydiv"&gt;Content&lt;/div&gt; &lt;style type="text/css"&gt; #mydiv {border: solid black 1px;} #mydiv {border: dashed red 1%;} #mydiv {border: none;} &lt;/style&gt;


What is the syntax of the command to display a user's path of execution?

echo $PATH


Which websites allow you access to free menu templates?

Daily syntax is a website where free menu templates can be found in CSS. Also this can be found on CSS menu market and in tutorials how to run a cafe/restaurant.


How do you add a border to a div in XHTML strict?

You use CSS.If you have this document:---...---and add this CSS rule (in a ... tag or a separate file):---.test { border: 1px solid black; }---you will get a 1 pixel black border around the div.Check out CSS for other options.


What property in the XHTML link tag when configuring CSS to display a printed page?

If you mean: When configuring CSS to display a printed page, what property is used in the XHTML link tag?The answer is: the media attribute or media="print"Example:


What is the correct CSS syntax for making all the elements bold?

p { font-weight: bold; /* font-weight: 700; does the same */ }