Home > database >  Unable to change border color of div by having bootstrap
Unable to change border color of div by having bootstrap

Time:12-10

<div role="alert" border="2pxenter code here` solid #f0f0f0

</div`

Could anybody help why am not able to change the border color from blue(by alert-info) to $f0f0f0 ?

CodePudding user response:

Your code is not clear here but I will try to answer from what i can get.

 <div  role="alert" style="border:2px solid #f0f0f0!important" ></div>

Try adding the border attribute in style tag and adding !important to the end.

CodePudding user response:

may be you inherit the parent css in your file

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>

<div  style="border:5px solid #f0f0f0;" role="alert">
  This is a info alert—check it out!
</div>

CodePudding user response:

Apply border-color and border style property this would allow to set the color for the borders.I have provided a sample HTML code for your reference else add

HTML code

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
  border-style: solid;
  border-color: coral;
}

div {
  border-style: solid;
  border-color: coral;
}
</style>
</head>
<body>

<h1>hello</h1>

<div>World</div>



</body>
</html>

  • Related