How to surround text with a rectangle?

Discussion in 'HTML' started by Bruce W...1, Oct 19, 2003.

  1. Bruce W...1

    Bruce W...1 Guest

    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.
     
    Bruce W...1, Oct 19, 2003
    #1
    1. Advertising

  2. Bruce W...1

    Eric Bohlman Guest

    "Bruce W...1" <> wrote in
    news::

    > 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.
     
    Eric Bohlman, Oct 19, 2003
    #2
    1. Advertising

  3. Bruce W...1

    brucie Guest

    In post <>
    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.


    aaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

    > 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
     
    brucie, Oct 19, 2003
    #3
  4. 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.
     
    Beauregard T. Shagnasty, Oct 19, 2003
    #4
  5. Bruce W...1

    Sid Ismail Guest

    On Sat, 18 Oct 2003 19:58:05 -0400, "Bruce W...1" <>
    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
     
    Sid Ismail, Oct 19, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. comcast
    Replies:
    5
    Views:
    417
    giganews
    Mar 3, 2004
  2. .rhavin grobert

    how to surround a constant with quotes?

    .rhavin grobert, Mar 13, 2007, in forum: C Programming
    Replies:
    5
    Views:
    351
    Old Wolf
    Mar 13, 2007
  3. Mark B
    Replies:
    1
    Views:
    1,640
    Andrew Morton
    Jul 10, 2009
  4. Ivan Vega
    Replies:
    8
    Views:
    97
    Ivan V.
    Jul 4, 2007
  5. toralf
    Replies:
    5
    Views:
    178
    toralf
    Sep 14, 2009
Loading...

Share This Page