I have text with text-align: justify; , the property is inherited in links and other nested inline elements in this text. I want to set a different text alignment mode for some of them, for example text-align: center; , but I can not. Firebug shows that the parent style is overridden, but the nested inline element is still justified. I noticed this strange behavior in many browsers and obviously they do it by specification? Is it really by design? How to get around this?
EDIT: some sample code. A span with ID = span1 cannot determine the text's own alignment. It should be aligned to the right, but instead it is centered. While I was experimenting, I noticed that inline elements cannot determine text alignment at all. Very strange.
<html> <head> <style type="text/css"> #cubic { width: 495px; height: 200px; background-color: green; text-align: center} #span1 {text-align: right; color: red} </style> </head> <body> <p id="cubic"> <span id="span1">This is span 1</span> </p> </body> </html>
source share