Skip to main content

Posts

Showing posts with the label text alignment

CSS - Borders

The border properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change The border-color Specifies the color of a border. The border-style Specifies whether a border should be solid, dashed line, double line, or one of the other possible values. The border-width Specifies the width of a border. Now we will see how to use these properties with examples. The border-color Property: The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties: border-bottom-color changes the color of bottom border. border-top-color changes the color of top border. border-left-color changes the color of left border. border-right-color changes the color of right border. The border-style Property: The border-style property allows...

Centering Text with CSS

Centering text and other elements can easily be done with the CSS text-align property. Applying this to an internal or external stylesheet: p {text-align: center;} or this to inline styling: This is centered text

Html Interview Questions

Which browsers support HTML 5? Almost all browsers i.e. Safari, Chrome, Firefox, Opera, Internet Explorer support HTML 5. What is SVG? SVG stands for scalable vector graphics. It’s a text based graphic language which draws images using text, lines, dots etc. This makes it lightweight and renders faster. What is canvas in HTML 5? Canvas is an HTML area on which you can draw graphics. What are the restrictions of Web Worker thread? Web worker threads cannot modify HTML elements, global variables and some window properties like Window.Location. You are free to use javascript data types, XMLHttpRequest calls etc. How to terminate a web worker? w.terminate();

Formatting and Styling Text in CSS

Text indention [text-indent] The property text-indent allows you to add an elegant touch to text paragraphs by applying an indent to the first line of the paragraph. p { text-indent: 10px; } Text alignment [text-align] The CSS property text-align corresponds to the attribute align used in old versions of HTML. Text can either be aligned to the left, to the right or centred. In addition to this, the value justify will stretch each line so that both the right and left margins are straight. p { text-align: left; } h1{ text-align: right; } h2{ text-align: center; } b { text-align: justify; } Text decoration [text-decoration] The property text-decoration makes it is possible to add different "decorations" or "effects" to text. Some properties are underline, overline, line-through. h1 { text-decoration: underline; } h2 { text-decoration: overline; } h3 { text-decoration: l...