Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to surround text with a rectangle?

Reply
Thread Tools

How to surround text with a rectangle?

 
 
Bruce W...1
Guest
Posts: n/a
 
      10-18-2003
To make a one pixel box around text (or whatever) in the past I've
enclosed a table within a table. But I get the feeling there's an
easier way.

Seems like it has something to do with the div tag and style sheet.
What attribute of a div tag would cause a single pixel box? How is this
done?

Thanks for your help.
 
Reply With Quote
 
 
 
 
Eric Bohlman
Guest
Posts: n/a
 
      10-19-2003
"Bruce W...1" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> To make a one pixel box around text (or whatever) in the past I've
> enclosed a table within a table. But I get the feeling there's an
> easier way.
>
> Seems like it has something to do with the div tag and style sheet.
> What attribute of a div tag would cause a single pixel box? How is this
> done?


Border. Check any CSS tutorial for how to specify it. Note that you can
specify a border for any element, not just a <div>; for example, a style of

p {border: 1px solid black;}

will put a border around every paragraph.
 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-19-2003
In post <(E-Mail Removed)>
Bruce W...1 said...

> To make a one pixel box around text (or whatever) in the past I've
> enclosed a table within a table.


aaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa

> But I get the feeling there's an easier way.


<p style="border:1px solid red;">some text</p>

although external css is much better than inline. e.g:

in your <head>:
<link rel="stylesheet" href="style.css" type="text/css" media="screen">

the content of the style.css file:

..red-border{border:1px solid red;}

in your html:

<p class="red-border">some text</p>

or you may want to put the css in your <head> (still not as good as
external)

<style type="text/css" media="screen">
..red-border{border:1px solid red;}
</style>

<p class="red-border">some text</p>



--
brucie.
19/October/2003 10:02:05 am
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      10-19-2003
Bruce W...1 pounced upon this pigeonhole and pronounced:
> To make a one pixel box around text (or whatever) in the past I've
> enclosed a table within a table. But I get the feeling there's an
> easier way.
>
> Seems like it has something to do with the div tag and style sheet.
> What attribute of a div tag would cause a single pixel box? How is this
> done?


..bordered { border: 1px solid red; padding: 0.25em; }


<p class="bordered">This text has a box around it, with some space in case
you asked.</p>

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
Sid Ismail
Guest
Posts: n/a
 
      10-19-2003
On Sat, 18 Oct 2003 19:58:05 -0400, "Bruce W...1" <(E-Mail Removed)>
wrote:

: To make a one pixel box around text (or whatever) in the past I've
: enclosed a table within a table. But I get the feeling there's an
: easier way.

Pad your table using CSS.

Sid
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Surround Display.... bigal Hardware 30 03-22-2006 06:04 AM
Zalman Theatre 6 Surround Headphones Review @ PC Modding Mal Silverstrand Front Page News 0 06-21-2005 07:52 PM
Possible to surround a table with a cell...after the fact? comcast HTML 5 03-03-2004 11:08 PM
Surround sound System Help CyBorg 0091 Computer Support 1 10-20-2003 08:10 AM
Surround Sound Test File? mhicaoidh Computer Support 1 07-25-2003 05:51 AM



Advertisments