473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How would you center this?

How would you center the text for this side bar code in the stylesheet.css? If I move the padding it will center some of them, but then others will be out of place. How do I make it directly centered over it's designated area?

Expand|Select|Wrap|Line Numbers
  1. #sidebar .block h2 { background: url('images/sidebar_block_h.png') no-repeat; min-height: 27px; width: 200px; font-family: Century Gothic, sans-serif; margin: 0px 0px 6px -20px; color: #7a7979; font-size: 1.5em; padding: 0 0 0 55px; font-weight: lighter; text-shadow: 1px 1px 1px #fff;  }
The code defines what the text is and where it is for my sidebar widgets in wordpress. Thanks a bunch in advanced!
Dec 22 '10 #1
2 1336
Rabbit
12,516 Expert Mod 8TB
text-align:center doesn't work?
Dec 22 '10 #2
It should work -

#sidebar .block h2 {
background: url('images/sidebar_block_h.png') no-repeat;
min-height: 27px;
width: 200px;
font-family: Century Gothic, sans-serif;
/*margin: 0px 0px 6px -20px;*/
color: #7a7979;
font-size: 1.5em;
/*padding: 0 0 0 55px;*/
font-weight: lighter;
text-shadow: 1px 1px 1px #fff;
text-align: center;
}
Dec 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Christopher Benson-Manica | last post by:
See http://ataru.gomen.org/files/test.html: <html> <head> <title>Test page</title> <style type="text/css"> .center { margin-left: auto; margin-right: auto } </style> </head> <body>
2
by: MK | last post by:
Hi, I don't have much experience with Javascript and have a simple question. Suppose one wants to write some text in the web page which needs to be center aligned, then how to do it? The...
6
by: Blue® | last post by:
The page below creates a popup message on the screen. It printed the popup box 30 pixels from the left: document.getElementById("dwindow").style.left="30px" How do I modify it so that the...
4
by: Joey | last post by:
Does anyone know how to center this sample webpage in Firefox? If so, will you provide the example as it applies to this sample webpage? I have read numerous posts and articles on how to center...
4
by: Phillip Vong | last post by:
Using VS2005 / VB.NET / ASP.NET Newbie trying to learn. I have a simple label and I want to center this on the page, but I can not. When I hightlight this in VS2005 and say to center it, it...
5
iam_clint
by: iam_clint | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
2
by: CSSnewbie | last post by:
Here is the code snippet: #miniflex { width: 780px; float: left; font-size: 20px; margin: 0;padding: 0 10px 0 10px; border-bottom: 1px solid #6B8E23; position:relative;
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
3
by: aashishn86 | last post by:
var weekend = ; var weekendColor = "#e0e0e0"; var fontface = "Verdana"; var fontsize = 1; var gNow = new Date(); var ggWinCal; isNav = (navigator.appName.indexOf("Netscape") != -1) ? true :...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.