'Why doesn't Bootstrap work when I have CSS on?
Hey I am new to Web Design and I am making my project for school class. My bootstrap won't seem to work when I have CSS on, but when I comment out my css bootstrap seems to work. I tried it with divs of class "blokkviz". Here is my HTML:
<!DOCTYPE html>
<html lang="en">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="style.css?v=1.0" rel="stylesheet" type="text/css" />
</head>
<body class="telo" id="body1">
<div class="container-fluid" id="prvi">
<img src="kviz.jpg" id="logo">
Sajt namenjen za kviz
</div>
<div class="grupa">
<h1 class="naslovGrupe">C#</h1>
<div class="blokkviz" class="col-md-6"class="col-lg-6">
<h2 style="font-weight: bold">Pocetnicki kviz</h2>
<h6 style="margin-left: 10px; margin-top: 15px;">Kviz namenjen pocetnicima ili osobama koje zele da obnove pocetno znanje C#</h6>
<div style="margin-left:13px; margin-top:80px"> Trajanje 5-10 min</div>
<button id="prvikviz" class="zapocni">Zapocni</button>
</div>
<div class="blokkviz" class="col-md-6"class="col-lg-6">
<h2 style="font-weight: bold">Pocetnicki kviz</h2>
<h6 style="margin-left: 10px; margin-top: 15px;">Kviz namenjen pocetnicima ili osobama koje zele da obnove pocetno znanje C#</h6>
<div style="margin-left:13px; margin-top:80px"> Trajanje 5-10 min</div>
<button id="prvikviz" class="zapocni">Zapocni</button>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>
And here is the css:
#prvi{
background-color: rgb(250, 221, 26);
height: 90px;
text-align: center;
font-weight: bolder;
font-size: 30px;
padding-top: 15px;
color:white;
text-shadow: 2px 2px #000000;
}
.telo{
background-color: lightblue;
}
#logo{
position:absolute;
top:0;
left:0;
height:80px
}
.blokkviz{
float:left;
width: 300px;
height: 300px;
display: block;
border: 2px solid black;
padding: 5px 10px;
margin-top: 30px;
margin-left: 30px;
margin-right: 100px;
background-color: rgb(226, 224, 224);
}
h2{
text-align: center;
}
h1{
margin: 15px;
margin-top: 60px;
}
.grupa{
height: 500px;
border: 3px solid black;
}
#prvikviz{
position:absolute;
left: 250px;
top: 460px;
}
.zapocni{
background-color: rgb(24, 141, 219);
color:white;
font-weight: bold;
}
.pitanja{
margin-left: 300px;
line-height: 27px;
margin-top: 50px;
margin-right: 150px;
}
.povratakNaPocetak{
position: relative;
left: 5px;
top: 5px;
border: 2px solid gray;
}
input[type="radio"]{
margin: 10px;
}
.predaj{
margin-bottom: 110px;
margin-top: 30px;
margin-left: 12px;
font-size: 20px;
font-weight: bold;
background-color: rgb(24, 141, 219);
color:white;
border: 3px solid rgb(24, 141, 219);
}
.naslovGrupe{
margin: 15px;
}
Note: There might be some stuff that isn't used anywhere else. That's because of my JavaScript file and another html file but it seems like the problem is in css so i only added these 2.
Solution 1:[1]
I think it's not working due to the way you have structred the class
class="blokkviz" class="col-md-6" class="col-lg-6"
It's going to work better if you organise like below, you only need 1 class with all the variables listed in it.
class="col-md-6 col-lg-6 blokkviz"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cutey from Cute Code |
