Solved

how to put the text in the middle and little bigger

Posted on 2006-07-19
3
1,160 Views
Last Modified: 2010-05-18
I have this stylesheet code

.event .title & .event .date write text in a blue box
but the problem is that text shows up top aligned, but i need it to centered

Also the text is not clearly visible, what text or text size should I use to make it clearer
Thanks

------------------------------------------
.event {
      border: 0px
      padding: 5px ;
    width: 500px ;
   }

.event .title {
    width: 50% ;
      height: 20px;
      background-color: #52769A ;
      font-size: 10px;
      color: #FFFFFF;
      margin-bottom:0px;
   
    float: left ;
   }

.event .date {
    width: 50% ;
      height: 20px;
    background-color: #52769A ;
    text-align: right ;
    float: right ;
      font-size: 10px;
      color: #FFFFFF;
      margin-bottom:0px;
   }
0
Comment
Question by:huzefaq
3 Comments
 
LVL 5

Accepted Solution

by:
koolie earned 500 total points
ID: 17142903
for that you use vertical-align: middle;
also, if you use this in the html code itself, it's <td valign="middle">
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17149502
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Title</title>
<style type="text/css">

.event {
  float: left;
  clear: left;
  width: 500px ;
  padding: 5px ;
  font-size: 100%;
  background-color: #52769A ;
  color: #FFFFFF;
}

.event .title {
  float: left ;
}

.event .date {
  float: right ;
}

</style>
</head>
<body>

  <div class="event">
    <div class="title">title 1</div>
    <div class="date">date 1</div>
  </div>

  <div class="event">
    <div class="title">title 2</div>
    <div class="date">date 2</div>
  </div>

</body>
</html>


To change the font size, change the "100%" in "font-size: 100%;" to some other value.
0
 

Author Comment

by:huzefaq
ID: 17194610
koolie which td shold I use the valign
thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

757 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

17 Experts available now in Live!

Get 1:1 Help Now