answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you add a border to a div in XHTML strict?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Is the 'div' tag part of HTML or XHTML?

The "div" tag is part of both languages.


What are the attributes that could be use within divtag in HTML?

The standard attributes of the DIV tag are:id, class, title, style, dir, lang, xml:lang.More information can be found in the "Related Links" section below.Note: The "align" attribute of the div element was deprecated in HTML 4.01, and is not supported in XHTML 1.0 Strict DTD.


What is the HTML code to add a border to a picture?

For example this is the HTML code: <body> <div id="picture"> <img src="images/image.jpg" alt="this is image" /> </div> </body> In CSS: #picture img { border:2px solid #000066; }


What does a div tag do when using Dreamweaver CS3 xhtml and CSS?

The division tag is a "div" and is used to divide a page into sections. A div tag can be used to style a section, and style one or more sections differently than other sections.


What is an empty HTML element which does not have a closing tag?

<html> <body> <div></div> </body> </html> that is an empty div tag, there is nothing in between the <div> and </div>


In HTML how do you put the text boxes next to each other?

<html> <head><title></title></head> <body> <div position :absolute; top : 200px; left : 50px; border : solid;> This is first Box </div> <div position :absolute; top : 200px; left : 150px; border : solid;> This is Second Box </div> </body> </html>


How do you make border line in html?

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


How do you delete your bottom links on myspace?

<style> table tr td div font {display: none;} </style> <style> table td div {visibility:hidden;} table table td div {visibility:visible;} tr {background:transparent;}</style> <style> table tr td div div { visibility:hidden; display:none; border:0px!important; background-color:transparent; } </style>


How do you make your webpage content go to the center when you put the browser to fully expanded?

First, you need to contain all your content in a block level element. You might want to use DIV, or SECTION, or ARTICLE--the choice is yours. I'm going to use DIV because it's available in XHTML as well as HTML 5. <div> <!-- Content you want centered goes here --> </div> Then, in the CSS, you need to set that element to a specific width (otherwise it will default to 100%, and you won't see any change.) Obviously, you might us a class or id on your div. div { width: 60%; } Next, add a left and right margin to that div, and set that margin to "auto." This is how we make block level elements align to the center. div { width: 60%; margin-left: auto; margin-right: auto;} You can also use the shorthand version of the margin property, setting both top and bottom, then left and right with a single declaration. div {width: 60%; margin: 15px auto; } Viola! The element will now automatically center when you maximize the browser window.


How do you hide MySpace terms of use?

table tr td div font {display: none;}table td div {visibility:hidden;}table table td div {visibility:visible;}tr {background:transparent;}table tr td div div {visibility:hidden;display:none;border:0px!important;background-color:transparent;}


How can a parent DIV wrap around child DIVs which are floating left or right?

Make sure the child div's are just float's (no position absolute stuff). Add an empty div to the parent underneath all the child's with style="clear: both;"


How do you hide your navigation bar on MySpace?

<style type="text/css"> table table table table div {visibility:hidden;} div table table table table table div input, div a, td.text div {visibility:visible;} </style><a href="http://myspacecake.com/" target="_blank"><img src="http://myspacecake.com/img/button.gif" alt="Myspace Codes" style="position:absolute; left:0px; top: 0px;" border="0"></a>