2012年3月22日星期四

How to Align Text in HTML

When HTML and the web were first developed, these were for sharing of text only. Nobody expected in order to create fancy webpages with pictures, videos along with other content. Alternatively, there is just text, also it did not matter how it looked, if you got the best text. Ever since then, the web has changed a great deal. However, the fundamentals behind sending information, plain text, haven't changed a great deal. To align your text isn't what the web was designed to do, however, you can align your text in several various ways now.


Put your text in a container. To align text, it should be found in something. The easiest container is really a paragraph. Text found in a paragraph can look between a begin paragraph tag, <p>, and a finish paragraph tag, </p>. Add an alignment attribute. All HTML tags are permitted to have attributes inside them. This is actually the text that appears following a space in the tag. To setup alignment in a paragraph tag, you utilize the align tag. It'll seem like this to date: <p align Put in a value for the attribute. Just like other HTML tags, your attribute could be followed closely by a value. In this instance, the worthiness is going to be "center, " that will center your text in a paragraph. Always utilize the same sign between all attributes and values. The tag should now seem like this: <p align=center> Use CSS to align your text. If you work with another kind of container, like a span or div, you will have to use style sheets and CSS to align your text. In this instance, you will have to write code in your look sheet. If this is definitely an in-line style sheet, your CSS is going to be using a style attribute, such as this: <span style= Add the text-alignment style. Within your style sheet, to center your text, add the style "text-alignment: center. " Your in-line style sheet may seem like this: <span style='text-alignment: center; '>.



没有评论:

发表评论