How to set borders in html? How to set html border style

云罗郡主
Release: 2018-11-08 15:36:12
Original
18195 people have browsed it

How to set the border of html? How to set the border line of html? I believe many friends who are new to html will have such questions. This chapter will introduce to you how to set borders in HTML? How to set html border style. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. [Recommended learning: HTMLTutorial]

CSS Border image property is used to add image borders to certain elements. You don't need to use any HTML code to call the border image. Example syntax for a border image is as follows:.

#borderimg {
   border: 10px solid transparent;
   padding: 15px;}
Copy after login

The following is an example of setting an image as an element border:

<html>
   <head>
      <style>
         #borderimg1 { 
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: url(/css/images/border.png);
            border-image-repeat: round;
            border-image-slice: 30;
            border-image-width: 10px;
         }
         #borderimg2 { 
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: url(/css/images/border.png);
            border-image-repeat: round;
            border-image-slice: 30;
            border-image-width: 20px;
         }
         #borderimg3 { 
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: url(/css/images/border.png);
            border-image-repeat: round;
            border-image-slice: 30;
            border-image-width: 30px;
         }
      </style>
   </head>
   <body>
      <p id = "borderimg1">php网站是最好的网站</p>
      <p id = "borderimg2">php网站是最好的网站</p>
      <p id = "borderimg3">php网站是最好的网站</p>
   </body></html>
Copy after login

The display effect is as follows:

How to set borders in html? How to set html border styleThis This article brings you the content about how to set borders in html? The html border style setting method has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

The above is the detailed content of How to set borders in html? How to set html border style. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template