How do you make a vertical line using HTML?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
HTML5 custom elements (or pure CSS)
1. javascript
Register your element.
*The
-
is mandatory in all custom elements.2. css
*You might need to fiddle a bit with
display:inline-block|inline
becauseinline
won't expand to containing element's height. Use the margin to center the line within a container.3. instantiate
*Unfortunately you can't create custom self-closing tags.
usage
example: http://html5.qry.me/vertical-rule
Don't want to mess with javascript?
Simply apply this CSS class to your designated element.
css
*See notes above.
There isn't any tag to create a vertical line in HTML.
Method: You load a line image. Then you set its style like
"height: 100px ; width: 2px"
Method: You can use
<td>
tags<td style="border-left: 1px solid red; padding: 5px;"> X </td>
For an inline style I used this code:
and that positioned it directly in the center.
Vertical line right to the div
Vertical line left to the div
You can also make a vertical line using HTML horizontal line
<hr />
I used a combination of the "hr" code suggested, and here's what my code looks like:
I simply changed the value of the "left" pixel value to position it. (I used the vertical line to line-up content on my webpage, and then I removed it.)