HighDots Forums  

Strange Text Align Right problem

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Strange Text Align Right problem in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Wier
 
Posts: n/a

Default Strange Text Align Right problem - 06-13-2009 , 10:48 AM






I inherited this huge app that has multiple stylesheets, all interacting
with one another, divs inside of divs with different classes for each,
tc. - - - you get the picture.

we have 3 TextAlign classes we use throughout the site (left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line is
"text-align:center", the text align directive is totally ignored (it aligns
left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override something
like this)?

Reply With Quote
  #2  
Old   
John Hosking
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 11:39 AM






David Wier wrote:
Quote:
I inherited this huge app that has multiple stylesheets, all interacting
with one another,
I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets. It's more like the *rules* are cascading, AIUI, but I
expect that none of this is relevant to you, even if I've got it right.

Quote:
divs inside of divs with different classes for each,
tc. - - - you get the picture.
A URL would give us an even better picture. ;-)

Quote:
we have 3 TextAlign classes we use throughout the site (left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line
is "text-align:center", the text align directive is totally ignored (it
aligns left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override
something like this)?
Lots of ideas, and a couple of suspicions, but I won't bother sharing
them (or testing them here in my browsers) until you point us to a URL
(preferably of some minimalistic, valid code).


--
John
Jukka or somebody else may be along soon to comment about using classes
named for their presumed effects, but I'm not going to mention such a thing.

Reply With Quote
  #3  
Old   
Adrienne
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 11:46 AM



Gazing into my crystal ball I observed David Wier writing in
<1%OYl.6248$7C4.743 (AT) newsfe04 (DOT) iad>:

Quote:
I inherited this huge app that has multiple stylesheets, all interacting
with one another, divs inside of divs with different classes for each,
tc. - - - you get the picture.

we have 3 TextAlign classes we use throughout the site (left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line is
"text-align:center", the text align directive is totally ignored (it aligns
left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override something
like this)?
I feel for you, brother!

I suggest:
1. Using Firebug (extension for Firefox) to see what is overriding
what, figuring out how to fix it, and then see where this is also
happening.
2. Look at the structure of the documents. Start
using structural markup, so that you are styling elements, and not
depending on using a lot of classes, unless it's an exception, eg: #nav
a:link.thispage
3. Start with a new stylesheet that is more structurally designed, and
remove a lot of these classes and inline style from the markup.

Good luck!


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #4  
Old   
David Wier
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 12:59 PM



Sorry, but this section of pages is behind a subscription area and I can't
make public, getting into that section

I'm totally open to suspicions, etc or situations in which this would not
work, though.


"John Hosking" <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote

Quote:
David Wier wrote:
I inherited this huge app that has multiple stylesheets, all interacting
with one another,

I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets. It's more like the *rules* are cascading, AIUI, but I
expect that none of this is relevant to you, even if I've got it right.

divs inside of divs with different classes for each, tc. - - - you get
the picture.

A URL would give us an even better picture. ;-)


we have 3 TextAlign classes we use throughout the site
(left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line is
"text-align:center", the text align directive is totally ignored (it
aligns left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override
something like this)?

Lots of ideas, and a couple of suspicions, but I won't bother sharing them
(or testing them here in my browsers) until you point us to a URL
(preferably of some minimalistic, valid code).


--
John
Jukka or somebody else may be along soon to comment about using classes
named for their presumed effects, but I'm not going to mention such a
thing.

Reply With Quote
  #5  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 02:41 PM



David Wier wrote:
Quote:
I inherited this huge app that has multiple stylesheets, all interacting
with one another, divs inside of divs with different classes for each,
tc. - - - you get the picture.

we have 3 TextAlign classes we use throughout the site (left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line
is "text-align:center", the text align directive is totally ignored (it
aligns left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override
something like this)?
Styles are probably cascading in a way you do not expect. You can get
what you expect by defining your classes more carefully, but often it is
easier to just use the "!important" qualifier in the CSS rules which
concern you.

Reply With Quote
  #6  
Old   
Adrienne
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 05:13 PM



Gazing into my crystal ball I observed David Wier writing in
<lWQYl.7579$mX2.3419 (AT) newsfe05 (DOT) iad>:

Please do not top post. Posting corrected, see reply at bottom.

Quote:
"John Hosking" <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote in message
news:4a33ca39$1_7 (AT) news (DOT) bluewin.ch...
David Wier wrote:
I inherited this huge app that has multiple stylesheets, all interacting
with one another,

I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets. It's more like the *rules* are cascading, AIUI, but I
expect that none of this is relevant to you, even if I've got it right.

divs inside of divs with different classes for each, tc. - - - you get
the picture.

A URL would give us an even better picture. ;-)


we have 3 TextAlign classes we use throughout the site
(left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it works.

However - if I assign our TextAlignRight class in which the only line is
"text-align:center", the text align directive is totally ignored (it
aligns left).

To add to the situation, if I use our TextAlignCenter class - that works!

Any ideas on this (or situations you know of which will override
something like this)?

Lots of ideas, and a couple of suspicions, but I won't bother sharing them
(or testing them here in my browsers) until you point us to a URL
(preferably of some minimalistic, valid code).


--
John
Jukka or somebody else may be along soon to comment about using classes
named for their presumed effects, but I'm not going to mention such a
thing.
Sorry, but this section of pages is behind a subscription area and I can't
make public, getting into that section

I'm totally open to suspicions, etc or situations in which this would not
work, though.


Being behind a subscription area is meaningless. Open a browser, go to
the page in question, save it and upload it somewhere on a public
server. If there is sensitve information in the content, then replace
it with Lorum Ipsum text before doing so.

-- Adrienne Boswell at Home
Arbpen Web Site Design Services http://www.cavalcade-of-coding.info Please
respond to the group so others can share

Reply With Quote
  #7  
Old   
dorayme
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 07:01 PM



In article <4a33ca39$1_7 (AT) news (DOT) bluewin.ch>,
John Hosking <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote:

Quote:
I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets.
I can understand you being nervous, I had a bad experience once.

I heard a huge commotion and went outside to see what was happening. It
was a terrible fight among stylesheets. I have seen men fighting, and I
have seen the occasional fights between women, I have seen dogs and cats
fighting and, I can tell you, nothing prepared me for this.

Some of the later stylesheets were bullying the earlier ones. It got so
bad that fights broke out within stylesheets and what made the whole
thing quite vicious was that groups of the rules broke out of their
normal gangs and viciously attacked rules in other gangs.

Cascade indeed! Such a polite term. The reality is very different. It is
a nasty brutish affair. They are dynamite. Best to have one or *very
few* loyal gangs, with rules that get on nicely with each other.

--
dorayme

Reply With Quote
  #8  
Old   
Adrienne
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 10:20 PM



Gazing into my crystal ball I observed dorayme writing in
<doraymeRidThis-77DDD1.09013614062009 (AT) news (DOT) albasani.net>:

Quote:
In article <4a33ca39$1_7 (AT) news (DOT) bluewin.ch>,
John Hosking <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote:

I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets.

I can understand you being nervous, I had a bad experience once.

I heard a huge commotion and went outside to see what was happening. It
was a terrible fight among stylesheets. I have seen men fighting, and I
have seen the occasional fights between women, I have seen dogs and cats
fighting and, I can tell you, nothing prepared me for this.

Some of the later stylesheets were bullying the earlier ones. It got so
bad that fights broke out within stylesheets and what made the whole
thing quite vicious was that groups of the rules broke out of their
normal gangs and viciously attacked rules in other gangs.

Cascade indeed! Such a polite term. The reality is very different. It is
a nasty brutish affair. They are dynamite. Best to have one or *very
few* loyal gangs, with rules that get on nicely with each other.
I was told to take a break from trying to figure out some logic rules, and
I must say, I am certainly glad I did. This is priceless! I see this in
my mind - rules on elements as the police, rules on ids beating up rules
on classes and pseudo classes just standing there maniacally laughing.

Thank you again for a wonderful break!


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #9  
Old   
David Wier
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 11:15 PM



"Adrienne" <arbpen (AT) yahoo (DOT) com> wrote

Quote:
Gazing into my crystal ball I observed David Wier writing in
lWQYl.7579$mX2.3419 (AT) newsfe05 (DOT) iad>:

Please do not top post. Posting corrected, see reply at bottom.

"John Hosking" <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote in message
news:4a33ca39$1_7 (AT) news (DOT) bluewin.ch...
David Wier wrote:
I inherited this huge app that has multiple stylesheets, all
interacting
with one another,

I would be glad to argue that stylesheets aren't the kind of things that
"interact" with each other, in a strict sense. There is some cascading
(the "C" in "CSS") but I'm nervous about calling that an interaction
between sheets. It's more like the *rules* are cascading, AIUI, but I
expect that none of this is relevant to you, even if I've got it right.

divs inside of divs with different classes for each, tc. - - - you
get
the picture.

A URL would give us an even better picture. ;-)


we have 3 TextAlign classes we use throughout the site
(left/right/center)

In some areas, Inside a table we have a strange anomoly - if I hardcode
style="text-align:center" for a paragraph inside a Table cell, it
works.

However - if I assign our TextAlignRight class in which the only line
is
"text-align:center", the text align directive is totally ignored (it
aligns left).

To add to the situation, if I use our TextAlignCenter class - that
works!

Any ideas on this (or situations you know of which will override
something like this)?

Lots of ideas, and a couple of suspicions, but I won't bother sharing
them
(or testing them here in my browsers) until you point us to a URL
(preferably of some minimalistic, valid code).


--
John
Jukka or somebody else may be along soon to comment about using classes
named for their presumed effects, but I'm not going to mention such a
thing.
Sorry, but this section of pages is behind a subscription area and I
can't
make public, getting into that section

I'm totally open to suspicions, etc or situations in which this would not
work, though.


Being behind a subscription area is meaningless. Open a browser, go to
the page in question, save it and upload it somewhere on a public
server. If there is sensitve information in the content, then replace
it with Lorum Ipsum text before doing so.

-- Adrienne Boswell at Home
Arbpen Web Site Design Services http://www.cavalcade-of-coding.info Please
respond to the group so others can share

OK then - how about:
http://augustwind.com/augustwind/test/csstest.htm

Reply With Quote
  #10  
Old   
Gus Richter
 
Posts: n/a

Default Re: Strange Text Align Right problem - 06-13-2009 , 11:47 PM



David Wier wrote:
Quote:
OK then - how about:
http://augustwind.com/augustwind/test/csstest.htm


..ContainerBodyOnline td p{
padding: 0px;
margin:0px;
padding-left:5px;
padding-bottom:4px;
padding-top:4px;
/*text-align:left;*/}

--
Gus

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.