HTML and CSS Reference
In-Depth Information
page and dropped onto another element (though as you will see, you will likely only use
draggable for making this happen, as dropzone has yet to gain much browser sup-
port). What happens next is governed by JavaScript events.
Style
The style attribute provides a method of applying CSS styles directly to an element.
Any styles applied in this way will override styles set on the element elsewhere. Al-
though this can provide a quick way to apply styles to an element, it is best to avoid
this attribute altogether and provide the styles for your page in an external style sheet.
Having a clear separation between CSS and HTML code within your website provides
organizational and flexibility advantages, because it is far easier to find and disable CSS
rules when they are contained in a CSS file, instead of being spread between CSS and
HTML.
Text directionality
The dir attribute controls which way text flows. Text normally flows from left to right,
but if a language is used that flows the other direction, such as Arabic, the text needs
to go that way as well. The dir attribute provides this ability. If an entire block is in a
right-to-left language, use the value of “rtl” for right-to-left languages and “ltr” for left-
to-right languages on the container element, which will flip the alignment of the text and
punctuation:
<p dir="rtl">When rendered by a browser, this paragraph
will appear aligned to the right.</p>
<p>While this paragraph will not because it lacks a
<code>dir</code> attribute.</p>
A value of “auto” can also be given, which seeks to automatically determine the text
directionality based on the enclosed text.
Note The CSS direction property provides this same functionality and takes the
values inherit , ltr , and rtl . However, this CSS should NOT be used as this in-
formation should be embedded into the page itself so that the directionality of the tex-
tual content can still be determined even if the associated style sheet is disabled.
Search WWH ::




Custom Search