473,657 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get the text within this div to center?

2 New Member
I am using modx to create a site at www.mmwri.com.
The navigation is dynamically generated by Wayfinder. I am trying to style the text with the navigation div. I can make it look fine in any Mac browser but the spacing overflows the navigation to a second line in Windows Browsers. Any input would be appreciated. Thanks!

Here is the CSS:
Expand|Select|Wrap|Line Numbers
  1. #navigation        {     background-color: white; width: 800px;   display:block;
  2.  
  3.                     height:40px;  padding-bottom:10px;  margin-left: auto; margin-right: auto; }
  4.  
  5. #navigation ul    {    margin: 0; padding: 10px 0 0 0;  list-style:none;  }
  6.  
  7. #navigation    li    {    display:block; float:left; padding: 0 15px; text-align: center;
  8.                     border-right: 2px solid #00266D;  margin-left: auto; margin-right: auto; }
  9.  
  10. #navigation li.last    {    border-right: none; padding-right:0; margin-right:0;    }    
  11.  
  12. #navigation a    {    color:#09003A; font-family: Arial Narrow; 
  13.                     font-size:20px;text-decoration:none; }
  14. #navigation a:hover {text-decoration: underline; color: black; }
Jun 23 '10 #1
2 1312
JKing
1,206 Recognized Expert Top Contributor
I made a few edits to the following lines.
Give it a try.

Expand|Select|Wrap|Line Numbers
  1. #navigation ul    {    margin: 0; padding: 10px 0 0 0;  list-style:none; text-align:center; }
  2.  
  3. #navigation    li    {    display:inline; padding: 0 15px; text-align: center;
  4.                     border-right: 2px solid #00266D;  margin-left: auto; margin-right: auto; }
  5.  
Jun 23 '10 #2
bigguyjoe
2 New Member
Awesome, seems to work well. Thanks so much.
Jun 23 '10 #3

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

Similar topics

30
2417
by: BenOne© | last post by:
Hi, I am trying to create a simple two column layout, with a heading centred in the right column. I don't want to specify the size of the right column, but I am limiting the left column to 200 pixels in width. Is this possible? Thanks for any help.
3
15002
by: Charles Crume | last post by:
Hello; I'm fairly new to CSS, but have learned that Mozilla is supposed to be the most compliant in rendering. I have a web page that uses a style sheet with a class named "page_links" that centers the various links at the top of the page, just under a heading as in: ---------------- HEADING ---------------
8
2767
by: Tristan Miller | last post by:
Greetings. Is there any way of using CSS alone to make an object centered and with a dotted or dashed line extending on either side to the borders of the enclosing object? For example, I have the HTML heading <h1 class="centerline">Foo</h1> and I would like it to display as follows:
18
7884
by: ~john | last post by:
Sorry if this is a dumb question buy my CSS is pretty bad... but how do I get text to center vertically within a div tag? Here's my code below... the text is displaying on the far top-right. I would like it far right centered vertically. #test { width: 100%; height: 55px; margin: 0 0 0 0;
2
9942
by: ismailc | last post by:
Hi, I need help please! I want to vertical align the text within a text box. I can set the vertical align of the text box but not the text. My text box has a style property of: style ="height : 20px; border : 1px solid #CCCCCC;" but my text is to high on top in the text box
13
3297
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. Firefox and Safari on the other hand don't treat text-align in that way. In my tests on those browsers, they only centers images and text. Any DIVs, object/embeds or tables remain default unaligned and generally appear on the left. Considering...
0
197
by: none | last post by:
Sorry my bad I was setting the text property to an empty string... thanks for the help - CES "none" <none@none.comwrote in message news:eaJIxCA7IHA.2260@TK2MSFTNGP03.phx.gbl...
3
1933
by: smokinlabbit | last post by:
I'm trying to come up with a solution (but with no real direction to start with) where I'm trying to edit data in a td element of a table on the spot. What I want to do is when a td element containing text is clicked on, the text within this td becomes an input text field. The data within the text field, upon submission, be it via a button or enter or whatever, will be the new data within the td element after submission. Is there a viable...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.