horizontal
and to the left
and next to the logo
, and why, the links move to the right
, and are stacked vertically. you have to look at the box that is holding both the logo and the links. and when we look at that box we see the following css:display:flex
so they’re using flexbox and justify-content: space-between
. so basically in this case there are 2 boxes within the big navbar (class) box holding it and it will push the 2 logo and links boxes as far apart as possible within the navbar box holding it. I hope that helps explain it.
dev-tools
in your browser really helps. cause you can see what is going on. what css classes and attributes are being applied, and how big a box is.
dev-tools
before you add it in your code. to kinda try it out and play around.
@zdman135 wow thanks.
This really helps me a lot to basically understand what's going on in a bootstrap navbar.
Now I am understanding quite a bit more, where to start looking to understand the basic behaviour of a navbar created with bootstrap.
Basically I wanted to try out creating a layout similar to this one:
https://codepen.io/bradley1492/pen/mQKmyB?editors=0100
Hey guys! I've got a problem.
I've created a simple function that reads the price of an item and adds it to the "total price" section. The problem is that it reads the price of only one item. How can I modify it so it will read the price of all of the items (when the button has been clicked it reads the price of nearby div, not the first one).
Here is the example: https://codepen.io/tomaff/pen/oQQego
I want it to add 9.90 when clicked inside the div with 9.90, 15.30 when clicked inside the div with 15.30 and so on.
let data = {
breakLength: 0,
sessionLength: 0,
sessionTimer: 0,
incrementTimer: () => {
console.log(data.sessionTimer = data.sessionTimer + 1);
data.sessionTimer >= 60 ? data.sessionTimer = 0 : data.sessionTimer;
},
activateTimer: () => {
let startTimer = setInterval(data.incrementTimer, 1000);
startTimer;
},
resetTimer: () => {
clearInterval(data.activateTimer);
data.sessionTimer = 0;
}
};
document.querySelector('.start').addEventListener('click', function (e) {
data.activateTimer();
})
document.querySelector('.stop').addEventListener('click', function () {
clearInterval(data.activateTimer);
})
document.querySelector('.reset').addEventListener('click', function () {
data.resetTimer();
})
let data = {
breakLength: 0,
sessionLength: 0,
sessionTimer: 0,
timerId: null, // declare the timer id here
incrementTimer: () => {
console.log(data.sessionTimer = data.sessionTimer + 1);
data.sessionTimer >= 60 ? data.sessionTimer = 0 : data.sessionTimer;
},
activateTimer: () => {
data.timerId = setInterval(data.incrementTimer, 1000); // save the timer id
},
resetTimer: () => {
clearInterval(data.activateTimer);
data.sessionTimer = 0;
}
};
document.querySelector('.start').addEventListener('click', function (e) {
data.activateTimer();
})
document.querySelector('.stop').addEventListener('click', function () {
clearInterval(data.timerId); // clear interval using timer id
})
document.querySelector('.reset').addEventListener('click', function () {
data.resetTimer();
})