简体   繁体   中英

how can I add boostrap dropdown without using rel=“stylesheet”

Hello I am creating a website and I want to add some extra features. I have found this template , and I want to add some comboboxes(one full row for gender, three in one row for birthday).

I have found this bootstrap code for comboboxes:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>
<div class="container">
  <form>
    <div class="form-group">
      <select class="form-control" id="sel1">
        <option>1</option>
        <option>2</option>
      </select>
    </div>
  </form>
</div>
</body>
</html>

As you can see the this code is using rel="stylesheet" , it is possible to change it? because the template from codepen.io uses another style.css file.

Now if it can be possible to change it, can you suggest something else for having comboboxes that match with the style of codepen.io template?

According to W3Schools

The required rel attribute specifies the relationship between the current document and the linked document/resource.

It cannot negatively impact your code, you have just trouble with CSS.

Also you should read The Bootstrap's docs .

It is not a good idea to get rid of the bootstrap stylesheet because many tags with bootstrap classes will look out of place. You can add other stylesheets to your webpage, as long as you put them after the bootstrap stylesheet. This will make it so that the other stylesheet(s) will display everything they are supposed to, but the bootstrap stylesheet will style everything that the other stylesheet(s) do not specify.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM