Solved

Text placement using CSS

Posted on 1997-12-08
4
188 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:m110585
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
serobert earned 100 total points
ID: 1855883
This should work, but if you need any more help, please let me know.  You can email me at seanrobertson@hotmail.com

<html>
<head>
<title>DHTML Test</title>
<style type="text/css">
#sample {font-size:18pt}
</style>
</head>
<body bgcolor="#FFFFFF">
<h1>Sample</H1>
<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>
      </div>
    </td>
  </tr>  
</table>
</body>
</html>
0
 
LVL 1

Expert Comment

by:serobert
ID: 1855884
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.
0
 
LVL 1

Expert Comment

by:serobert
ID: 1855885
same goes with "height="74"".  Sorry about that, the editor I used to layout the table took a crap.
0
 

Author Comment

by:m110585
ID: 1855886
Turns out that IE 3.02 (4.70.1300) doesn't display what I'm trying to do in CSS. :-(
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now