Center Aligning in css Cant get to work

User 53489 Photo


Ambassador
10 posts

Hello

I need some help. I am trying to align center some text in two pages using css.

I am getting frustrated as to why I cannot modify the css to show the proper alignment.

So here is what I have, this is the DRAFT Site I am building, simple so far, just getting content and will add the rest. http://marietbrownattorneyatlaw.com/index.html

So what I want to do is get the Welcome: and Areas of Practice Shifted over more toward center

I do not want the words or content shifted, I just want it more centered away from the LEFT side.

Shesh an easy task for most, but today I must have my STUPIT hat on

The line of Text I am trying to work on is simple enough as well

#content .two_columns { float:left; display:inherit; width:450px; margin-right::15px}


Have done everything I know how. All I can do is get the two columns reversed and then both are up against the sides :/
User 2000538 Photo


Registered User
1,392 posts

Try adding some padding-left to the #content p and #content ul and #content h1
I know you believe you understand what you think I said...but I am not sure you realize that what you heard is not exactly what I meant.


User 562592 Photo


Registered User
2,038 posts

First, I noticed that you have two colons in your CSS. You will want to remove one of those (after margin-right.)

Second, the quick solution is to do this through html. Since you want welcome to be centered you put next to you heading tag:

<div align="center"><h1>Heading</h1></div>

Second, you cant set a margin right when you are floating left. Instead push the margin left. For example:

#content .two_columns { float:left; display:inherit; width:450px; margin-left:15px}

or just set the padding of your heading tag:

#content h1{padding-left:20px;}

hope this helps.

The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 463058 Photo


Ambassador
1,086 posts

R1-Limited wrote:
So what I want to do is get the Welcome: and Areas of Practice Shifted over more toward center

I do not want the words or content shifted, I just want it more centered away from the LEFT side.


I'm not sure if this will help, but...
#content .two_columns h2 {text-align:center}

User 562592 Photo


Registered User
2,038 posts

Cary's method will work, but only if the width is specified (or if the heading value is inherited), so that there is a center point, otherwise centering could cause the heading to float off. I like to use the margin's to control the centering process so that I get it exactly where I want it.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 53489 Photo


Ambassador
10 posts

tassietiger

Thanks, that put me into the correct location, just have to create a couple more classes to isolate the areas of concern. Thanks so much, now I understand why I was getting the results I was getting. The current CSS has many areas locked as common -- just need to isolate and separate the items I need.

Just learning more about CSS, and styling, its more then just a easy font choice anymore :P
User 2000538 Photo


Registered User
1,392 posts

You are most welcome :)
I know you believe you understand what you think I said...but I am not sure you realize that what you heard is not exactly what I meant.


User 463058 Photo


Ambassador
1,086 posts

Eric English wrote:
Cary's method will work, but only if the width is specified...


This is for centering the H2 headings, Welcome: and Areas of Practice, where width can't be given, nor is it necessary.
User 53489 Photo


Ambassador
10 posts

Well what I finally had to do was separate the #content li, this is what was giving me the fits. it was also controlling the tab menu lay out.

Since I was unable to really get the look I wanted (Simply Lack of Expertise in CSS/Layout) I opted to remove the content being controlled by #content li and just formatted it using non breaking space and unicode arrows

The result is this, and they are please

Attachments:
User 562592 Photo


Registered User
2,038 posts

It is a very very nice site. Very clean and elegant - perfect for a law firm page.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.