Can the text align-property only be used to align text or can we use it to align other content as well?
Answer
The text-align property is used to align the inner content of a block element. This means that in addition to aligning text, it can also be used to align inline or inline-block elements within a containing div.
You will learn more about inline, inline-block, and block level elements in the next exercise.
it gives both an explanation and an example you can play with, the combination of this should make it clear? Learning to read and understand documentation is a very good skill to have as programmer
yes but when i think of it i view it as for instance letâs say:
we have an (div) bla bla (/div) (couldnât type in divtags it actually worked so i left out the <)element or whatever as the parent element, wouldnât that mean that the text will be to the left of whatever is contained in the div?
whilst in case of a browser how does the text be aigned to the left of the browser since the text is to appear on the browser?
i think you misunderstood my question, since the instructions said that the browser will align the text to the left of the browser! i mean that seems impossible because the text of any webpage is shown in a web-browser such as mozilla firefox, google chrome , internet explorer & safari etc. if we for example have symbolise the browser with these to signs | browser symbole | then to align text to the left of the browser would be something like this: âtext that is left of the browserâ | browser symbole |
if text was left of the browser it would be in some other program or desktop that is not the browser or are they trying to say that the text is to be scrolled so that if the browser is rendered at some point the other text will be achieved by scrolling to the left?
The lesson url that is in the FAQ seems broken, do you have the correct one for me?
So your point is, that the text should say: left-hand side of the browser? Actually, that isnât even accurate. Its the left hand side of the element the text is in
Hi illpro1, I think you may have misread or misunderstood the text of explanation in the lesson. I am talking about this part
The text-align property can be set to one of the following three values: left â aligns text to the left hand side of its parent element, which in this case is the browser. Ok. This is not saying to the left of the browser window or the HTML page itself. If no âtext-alignâ rule is put in a .css file then by default the browser will align things to the left side of the browser window or view screen or however you like to think about viewing/looking at a web-page. You can prove this to yourself by making a simple HTML file using the <h>A Test</h>then displaying it your browser of choice. Itâs when you as the writer or author or maker of the web-page would like to have some header or paragraph or some other kind of element to appear lined up on the page somewhere else other than the left side is when you use the a text-align to place where you or your customer/client/friend wants it. I really hope this helps clear up the purpose of the text-align property as it is used in CSS files. Oh, and by the way I fully understand what you mean when you say how can the browser be considered the parent. To my mind the browser program isnât the âparentâ in a relational sense to any web-page/web-site. It is the program that displays the contents of the web-page/web-site. The only way I can wrap my mind around it as a âparentâ is to think in terms of containers(think of a boxes within boxes) and in this case the browser is kind of like the parent container and the operating system(windows,linux,etc.) is the parent of the browser program and the hardware(motherboard,memory, etc) is the parent of the operating system.
Regards, Wispring
Justify aligns the contents to both the left, middle, and the right by spacing out the words/text/child elements so that they fill the page equally. So, instead of moving everything over to the left, moving everything over to the right, or moving everything towards the midline/middle of the parent container, it spreads the contents out to the sides of the container and middle, evenly throughout.