html - Align Header and logo -


i new css , html , have problem while aligning logo , title in header:

enter image description here

i have tried several solutions have not succeed. appreciate if give me hint it. thanks.

html code:

<!  doctype html> <html> <head>   <meta charset="utf-8">   <title>title goes here</title>   <meta name="description" content="description of site goes here">   <meta name="keywords" content="keyword1, keyword2, keyword3">   <link href="css/style.css" rel="stylesheet" type="text/css"> </head> <body> <div class="page"> <div class="header" > <h1>  <img src="images/img1.jpg" width="250" height="190" float="right" />  text here </h1> </div> </body> </html> 

my css code:

body {     font-family: sans-serif,arial;     font-size: 12px;     color: #000000;     margin: 0px;     background-color:#d9d7d7; } h1, h2, h3, h4, h5, h6, p, ul, ol, li, form, input, textarea {     padding: 0px;     margin: 0px;     color: black; } .page {     width: 1000px;     float: left;     padding: 42px 0px 0px 0px;     position: center; }    .header {     position:absolute;      top:42px;      margin-left:-500px;      left:50%;     width: 1000px;     height: 200px;     background-color: white;     border-style: solid solid none solid;     border-width: thick;     } .header h1{     display: inline;     text-align: left;     font-family: cursive;     font-size: 45px;     color: black; } 

thanks

one solution use vertical-align: middle img like:

body {    font-family: sans-serif, arial;    font-size: 12px;    color: #000000;    margin: 0px;    background-color: #d9d7d7;  }  h1,  h2,  h3,  h4,  h5,  h6,  p,  ul,  ol,  li,  form,  input,  textarea {    padding: 0px;    margin: 0px;    color: black;  }  .page {    width: 1000px;    float: left;    padding: 42px 0px 0px 0px;  }  .header {    position: absolute;    top: 42px;    margin-left: -500px;    left: 50%;    width: 1000px;    background-color: white;    border-style: solid solid none solid;    border-width: thick;  }  .header h1 {    display: inline;    text-align: left;    font-family: cursive;    font-size: 45px;    color: black;  }  h1 img {    vertical-align: middle;  }
<div class="page">    <div class="header">        <h1>  <img src="images/img1.jpg" width="250" height="190"  />  text here </h1>      </div>

also float="right" isn't valid html attribute. take here image mdn valid image html attributes.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -