Solved

how to put the text in the middle and little bigger

Posted on 2006-07-19
3
1,161 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

929 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

12 Experts available now in Live!

Get 1:1 Help Now