In this Tutorial, we will see ways in which we can add borders to div elements in HTML Style attributes border and border-style,
Example 1: Solid Border
Some text
Code:
<div style="border:1px solid">Some text</div>
Example 2: Solid Border with color
Some text
Code:
<div style="border:1px solid #00ff22">Some text</div>
Example 3: Dotted Border with color
Some text
Code:
<div style="border:1px dotted red">Some text</div>
Example 4: Dashed Border with color
Some text
Code:
<div style="border:1px dashed red">Some text</div>
Example 5: Double Border
Some text
Code:
<div style="border-style:double">Some text</div>
Example 6: Groove Border
Some text
Code:
<div style="border-style: groove">Some text</div>
Example 7: Ridge Border
Some text
Code:
<div style="border-style: ridge">Some text</div>
Example 8: Inset Border
Some text
Code:
<div style="border-style: inset">Some text</div>
Example 9: Outset Border
Some text
Code:
<div style="border-style: outset">Some text</div>
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to Html,
- How to remove old 404 pages ulrs from Google crawler
- W3 HTML validator warning Unable to Determine Parse Mode
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- Align html element at the center of page vertically and horizontally
- HTML Images - Attributes and Formats
- 9 Border to DIV Element in HTML Examples
- Create HTML button that looks like a href hyperlink
- What is the doctype for HTML5?
- Simple Crossword Puzzle example using Pure HTML, CSS and JavaScript
- How to make a div tag clickable
- The author stylesheet specified in tag script is too long - document contains 21759 bytes whereas the limit is 10000 bytes
- W3 : character data is not allowed here html validation error
- How to set background color in HTML page?
- Auto Refresh Webpage after every x Second or Minute using Meta Tag?
- Default speed of Marquee tag : SCROLLAMOUNT
- Get HTML table td, tr or th inner content value with id or name attribute
- How to add multiple spaces between html page text
- Chessboard with pieces using pure HTML and CSS
- How to turn off autocomplete in input fields in HTML Form
- remove div vertical scroll
- Fibonacci series from 1 to 500 table
- Remove Html head and body tags from ckeditor source
- reCaptcha Verification expired. Check the checkbox again
- HTML5 CSS3 Color Codes List
- All directional arrows codes for HTML
More Posts:
- Fix: error: Jupyter command `jupyter-nbconvert` not found [VSCode] - Python
- How to know the Version of Notepad App on Windows 11 - Windows-11
- remove div vertical scroll - Html
- [Solution] WslRegisterDistribution failed with error: 0x80370102 VM on Mac - Windows
- How to Pretty Print JSON in PHP - PHP
- Adding Custom ASCII Text Banner in Spring Boot Application - Java
- Python: Convert int to binary String - Python
- SharePoint List redirect user after submitting form NewForm.aspx - SharePoint