So I have a pretty newbie question regarding HTML and CSS. I just started utilizing Twitter’s Bootstrap framework, and have this bit of code in the head of my index.html file:
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet"> <!-- Custom CSS Overwrite-->
<style type="text/css">
html{overflow-y:scroll;} <!-- Fixes "page shift" issue -->
</style>
The bootstrap.css file defines this, like so:
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
Does my declared CSS in the html file overwrite or append the html{} for the CSS? I’m hoping it’s append, because overwrite might screw things up down the road.
The reason I don’t just edit the bootstrap.css file is because I read it’s good practice to not edit the bootstrap.css file so that future upgrades go as smoothly as possible.
BTW if anyone is wondering what the overflow-y:scroll is for it’s to include a vertical scroll bar in your browser at all times, whether there’s scrollable material or not. Fixes the dreaded “page shift” issue, it’s the simplest solution I could find so far.
It will append it on. (Unless Bootstrap has changed the
overflow-yproperty of the html element.)This almost always happens in CSS.
So this:
Is the same as:
The only time it doesn’t apply is when you change the same value, because in CSS, you can’t have multiple values on properties.
I don’t know if Bootstrap has an
overflow-yproperty added on to the<html>element. If it does your page shift issue css will overwrite that. If it doesn’t then it will be “appended” on.