Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CSS text align issue

Posted on 2013-01-12
5
228 Views
Last Modified: 2013-02-03
I have a CSS stylesheet problem and I have tried every trick in the book, yes even exhausted google resources, I need to have the content block text-align: left!!!

Here is the code snippet:
the body tag is set to: text-align:center;margin:0 auto;

the content blocks contain the following:
container {width: 1080px;}
#content-container #content {width: 100%;}
#content-container #content #left {float: left; width: 340px; text-align: left;}
#content-container #content #right {float: left; width: 740px; text-align: left;}
.content-background {background:url(../images/common/cont1.png) repeat-y 0 0; margin: auto 0; text-align: left; clear: both;}

Here is the HTML:
    <div id="content">
        <div id="left">
           '''some stuff
        </div>
        <div id="right">
            '''some stuff
        </div>        
    </div>
0
Comment
Question by:karihaney
  • 2
  • 2
5 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38771104
It would have been more helpful to see more of your code together.  

1) You did not have a container div and not sure if it is a class or id
2) You did not have a content-container id which is what your css is calling for.  So either add the content-container div as I did below or change your css from

#content-container #content #left {float: left; width: 340px; text-align: left;}

to

 #content #left {float: left; width: 340px; text-align: left;}

Below works with your current css if you change

container {width: 1080px;}

to

.container {width: 1080px;}

  <div class="container">
  <div id="content-container">
     <div id="content">
        <div id="left">
           '''some stuff
        </div>
        <div id="right">
            '''some stuff
        </div>        
    </div>
    </div>
  </div>
0
 

Author Comment

by:karihaney
ID: 38825509
I've requested that this question be deleted for the following reason:

no contributions provided.  resolved the issue.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38825510
What did not work here?
0
 

Accepted Solution

by:
karihaney earned 0 total points
ID: 38833499
the only way I was able to get it to work effectively was to remove the align: center; margin: 0 auto; from the code.  The reason I didn't interact with anyone was because I ended up in the hospital, but I am happy to award whatever points you feel is warranted.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 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