CSS/HTML: Understanding effect of removing a CSS selector - beginner -


i beginner in css/html world , today i've been playing example , not understand following:

there css , html file reconstruct in simple way google homepage.

the result ok, not understand why if css file remove first selector is:

#googlesearch {     font-family:arial;  } 

then refresh page result , 2 buttons "google search" , "i'm feeling lucky" way left, while keeping selector stay in center.

shouldn't selector affect font? why affects alignment of buttons? can't figure out sorry.

here codes, see first selector of css file 1 i'm talking about. removing result change sais above.

#googlesearch {    font-family: arial;  }    #buttons {    display: block;    /*background-color:blue;*/    height: 22px;    width: 250px;    margin: auto;    margin-top: 10px;    text-align: center;  }    body,  html {    height: 100%;  }    #wrapper {    min-height: 100%;    position: relative;    padding: 0;    margin: 0;  }    .logo img {    display: block;    width: 269px;    height: 95px;    margin: auto;    margin-top: 80px;    padding-top: 112px;  }    #header {    width: 100%;    height: 100px;    /*background-color:green*/    ;  }    .navbar {    /*background-color: red;*/    float: right;  }    .navli {    display: inline-block;    font-family: arial;    float: left;    height: 30px;    line-height: 30px;  }    .navli {    text-decoration: none;    color: #404040;    font-size: 13px;    padding-left: 15px;  }    .navli a:hover {    text-decoration: underline;  }    #icon {    /*margin-top:10px;*/    padding-left: 15px;    /*bottom:0;          position:relative;*/  }    .searchbar {    width: 400px;    height: 28px;    margin: auto;    display: block;    /*background-color:red;*/    padding-top: 10px;  }    #search1 {    width: 400px;    height: 28px;    margin: auto;  }    #footer {    position: absolute;    bottom: 0;    height: 60px;    width: 100%;    background-color: #f2f2f2;    clear: both;    display: block;    border-top: 1px solid #e4e4e4;  }    #leftfoot {    width: 300px;    left: 0;    /*background-color:blue;*/    display: inline-block;  }    .lf {    display: inline-block;  }    .lf {    text-decoration: none;    color: #404040;    font-size: 13px;    font-family: arial;    padding-left: 15px;  }    .lf a:hover {    text-decoration: underline;  }    #rightfoot {    width: 250px;    float: right;    /*background-color:blue;*/    padding: 0;    margin: 0;  }    .rf {    display: inline-block;    margin: auto;  }    .rf {    text-decoration: none;    color: #404040;    font-size: 13px;    padding-left: 15px;    font-family: arial;  }    .rf a:hover {    text-decoration: underline;  }
<div id="wrapper">    <div id="header">      <ul class="navbar">        <li class="navli"><a href="#"> +you </a>          </li>        <li class="navli"><a href="#">gmail</a>          </li>        <li class="navli"><a href="#">images</a>          </li>          <li class="navli"><a href="#">test@gmail.com</a>          </li>      </ul>    </div>    <div id="body">      <div class="logo">        <img src="https://www.google.com/images/srpr/logo11w.png" />      </div>      <div class="searchbar">        <input type="text" id="search1" />      </div>      <div id="buttons">        <input id="googlesearch" value="google search" type="submit">        <input id="secondbutton" value="i'm feeling lucky" type="submit">      </div>    </div>    <div id="footer">      <div id="leftfoot">        <ul>          <li class="lf"> <a href="#">advertising</a>            </li>          <li class="lf"> <a href="#">business</a>            </li>          <li class="lf"> <a href="#">about</a>            </li>        </ul>      </div>      <div id="rightfoot">        <ul>          <li class="rf"> <a href="#">privacy</a>            </li>          <li class="rf"> <a href="#">terms</a>            </li>          <li class="rf"> <a href="#">settings</a>            </li>        </ul>      </div>    </div>  </div>

thanking of in advance help


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -