How to set a border for an HTML div tag

前端 未结 9 843
予麋鹿
予麋鹿 2021-01-29 22:06

I am trying to define a border around a div tag in HTML. In some browsers the border does not appear.

Here is my HTML code:

相关标签:
9条回答
  • 2021-01-29 22:52

    You can use:

    border-style: solid;
    border-width: thin;
    border-color: #FFFFFF;
    

    You can change these as you see fit, though.

    0 讨论(0)
  • 2021-01-29 22:57
    <style>
    p{border: 1px solid red}
    div{border: 5px solid blue}
    

    Call me Ishmael.

    Just don't call me late for dinner.

    Call me Ishmael.

    Just don't call me late for dinner.

    0 讨论(0)
  • 2021-01-29 22:58
     .centerImge {
            display: block;
            margin-left: auto;
            margin-right: auto;
            width: 50%;
            height:50%;
        }
     <div>
     @foreach (var item in Model)
    {
    <span> <img src="@item.Thumbnail"  class="centerImge" /></span>
      <h3 style="text-align:center">  @item.CategoryName</h3>
    }
     </div>
    
    0 讨论(0)
提交回复
热议问题