
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS - vertical-align
Description
The vertical-align property determines the alignment of text within a line, or within a table cell.
Possible Values
baseline − The baseline of the element is aligned with the baseline of the parent element.
sub − The baseline of the element is lowered to the point appropriate for subscripted text.
super − The baseline of the element is raised to the point appropriate for superscripted text.
top − The top of the element's box is aligned with the top of the line box, in the context of inline content, or with the top of the table cell in the context of tables.
text-top − The top of the element's box is aligned with the top of the highest inline box in the line.
middle − The baseline of the element is aligned with the point defined by the baseline of the parent element plus half the x-height of the parent element's font, in the context of inline content.
bottom − The bottom of the element's box is aligned with the bottom of the line box, in the context of inline content, or with the bottom of the table cell in the context of tables.
text-bottom − The bottom of the element's box is aligned with the bottom of the lowest inline box in the line.
percentage − The baseline of the element is raised or lowered by the given percentage of the value for the property line-height.
length − The baseline of the element is raised or lowered by the given length value. Negative length values are permitted for this property. A length value of 0 for this property has the same effect as the value baseline.
Applies to
inline-level elements and elements with a display of table-cell.
DOM Syntax
object.style.verticalAlign = "baseline";
Example
Here is the example −
<html> <head> </head> <body> <table style = "height:200px; width:400px;border:1px solid red;"> <tr> <td style = "vertical-align:bottom;" > <p>This will be aligned to bottom of the cell.</p> </td> </tr> </table> </body> </html>
This will produce following result −