• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Text placement using CSS

How can I get the bottom edge of text to sit flush on the bottom border of a single-cell table using CSS?

I need to create a 300x150 px red box with the word SAMPLE sitting FLUSH on the bottom of the box.
  • 3
1 Solution
This should work, but if you need any more help, please let me know.  You can email me at seanrobertson@hotmail.com

<title>DHTML Test</title>
<style type="text/css">
#sample {font-size:18pt}
<body bgcolor="#FFFFFF">
<table border="0" width="300" height="150" cellspacing="0" cellpadding="0">
  <tr valign="BOTTOM">
    <td bgcolor="#FF0000" width="359" valign="BOTTOM" height="74">
      <div id="Layer1" style="position:relative; left:97; top:25; width:98; height:20; z-index:1;">
        <span ID="sample">SAMPLE</span>
the width attribute in the following line (which appeared in the table of the previous code):
<td bgcolor="#FF0000" width="359" valign="BOTTOM" height="74">
 can be removed so that the line appears as:
<td bgcolor="#FF0000" valign="BOTTOM" height="74">
It doesn't make any difference, but is just cleaner coding.
same goes with "height="74"".  Sorry about that, the editor I used to layout the table took a crap.
m110585Author Commented:
Turns out that IE 3.02 (4.70.1300) doesn't display what I'm trying to do in CSS. :-(
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now