Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS text align issue

Posted on 2013-01-12
5
Medium Priority
?
237 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
4 Comments
 
LVL 54

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 54

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

824 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