Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

borders 1

Status
Not open for further replies.

lfc77

Programmer
Aug 12, 2003
218
GB
How do I put a border around my text such as in ? It's not a standard HTML border, so how is it done?


Any help would be really appreciated.


Thanks,

Mike
 
Place the text inside of a table and set a border value for the table. If its an image just set a value for the border attribute of the image.

Hope this helps ...
 
That particular border has been defined using CSS.
Perhaps something like this:

Code:
table { border: 1px solid black; }

This overides a browsers standard rendering of a table border (normally that 3D effect).
 
Yes I might use a DIV too if I was building a CSS layout, but the page offered as an example is using a table to create the layout. A prefectly legitimate "Transitional" method.
Setting a table border with HTML will leave it up to the browser how to render the border. I wanted to point out that you can change how even a table border is displayed by using CSS.
 
My comment was more aimed at VBRookie than at you, Foamcow.

Question: "How do I put a border around my text"
VBRookie: "Place the text inside of a table and set a border value for the table"

That's a horribly long-winded way of doing it these days. why write this:
Code:
<table style="border: 1px solid black;">
  <tr>
    <td>
      Look Ma, a border!
    </td>
  </tr>
</table>
when you could write this:
Code:
<div style="border: 1px solid black;">
  Look Ma, a border!
</div>
Better still would be to define a class for that black border in a style sheet, then you could apply it to <div>s, <img>s, <p>s or any other element you liked.


-- Chris Hunt
 
you mean I have to read other posts too ;-P

hehe... point taken. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top