views:

32

answers:

2

sorry im a newbie in css, so please dnt be angry at me, i really wanted postion something like this:

taking in mind that the number will grow, so the text has to stay in the middle. if you get what i mean! :))

alt text

+1  A: 

if you're new to css, here's an exercise for you:

download Firebug for Firefox and sift through StackOverflow's code for how they position their numbers on the front page for things like views and answers. Rather than me telling you how to do it, you will actually learn not only how to use firebug, but some valuable CSS lessons as well :)

To do this, right click on the element you want to dig in to and click "Inspect Element". Then you can view and even edit the CSS to see how everything interacts with the actual document.

I promise you, nay, guarantee you that this will be a lot more helpful to you than if I straight up give you some simple CSS code to help you achieve that simple effect, especially if you plan on doing more CSS work in the future.

Jason
but stackoverflow deosnt have numbers or text showing next to each other like this?
getaway
Now THIS is an uncommonly valuable suggestion!
mingos
on the front page, they do exactly what you're looking to do. see where they have the number of answers, views, and votes?
Jason
thanks:) yeh i see where it is now, but the problem is im trying to have to place the two right next to each other, than below each other?
getaway
+1  A: 

In order to centre text:

text-align: center;

As for putting your content horizontally, you have more than one way of doing it.

  1. Use a table. Not the best idea, TBH, but the possibility exists.
  2. Use a CSS grid, such as http://www.1kbgrid.com/ - a way better idea.
  3. Use an unordered list. Set list style to none to get rid of bullets, and display the list items inline.
  4. Manually float your numbers.
mingos