ltg,

>I really did not want to post here and ask for help on centering
>text.  But I have created the simplest possible JQuery sample page,
>used Firebug, and still can't figure it out.
>
>Can anyone say what it would take to center text on this page:
>
>http://dev.hdgreetings.com/test.htm

You can do this purely in CSS:

.redButton {
  background-color:#E5214B; 
  color:white; 
  font-family:arial;
  font-weight:bolder;
  font-size:16px;
  letter-spacing: 0.5pt;
  text-align:center;
  width:150px; 
  height:50px;

  /* center text */
  position: fixed !important; 
  top: 50%;
  left: 50%;
  margin-top: -25px
  margin-left: -75px;
}

The idea is you're placing the div in the middle of the screen and then
using negative margins so that the very middle of the div is now dead
center. Without the negative margins, the top left of the div is in the
middle of the screen.

Also, I had to use the "!important" directive on the position, since the
corner plug-in looks to be setting the position to "relative". You could use
either an absolute position or a fixed position. I used fixed in this
example so that even if you scroll, the layer will stay dead center (which I
thought is probably what you were going after.

-Dan

Reply via email to