开发者

Chrome(Win) and Safari (OSX) look different for my html

开发者 https://www.devze.com 2023-04-06 16:39 出处:网络
I created a mock up here of some html and for some reason my site looks different on safari than how i want it to look on chrome. On chrome it looks correct but on safari on osx and on mobile phones i

I created a mock up here of some html and for some reason my site looks different on safari than how i want it to look on chrome. On chrome it looks correct but on safari on osx and on mobile phones it just looks a bit off and centered in random spaces. I am not sure how to make it so other browsers look like one?

You can see the difference here in chrome win and safari osx ( the first image chrome ) http://imgur.com/Z3kYG&SYZkW?full I just want it to look as it does on chrome but i cant figure out whats wrong with my code.

<div id="right-preview"><div id="background1"><div id="contentarea">
                <h4 id="time">01:59 AM</h3><br/><h4 class="username">Enter a name..</h3><div id="conversation"><div class="gBoxTall">
                                    <div class="right">
                                        <p class="message"> Your mom and I are going to divorce next month.</p>
                                    </div>
                                    <div class="bottom">
                                        <div class="right"></div>
                                    </div>
                                 </div><div class="wBoxTall">
                                    <div class="right">
                                        <p class="message"> Why ? Call me please.</p>
                                    </div>
                                    <div class="bo开发者_Python百科ttom">
                                        <div class="right"></div>
                                    </div>
                                 </div><div class="gBoxTall">
                                    <div class="right">
                                        <p class="message"> I wrote Disney and this phone changed it.</p>
                                    </div>
                                    <div class="bottom">
                                        <div class="right"></div>
                                    </div>
                                 </div></div>
                        </div></div>

This is my CSS code as well.

 * {
margin: 0;
padding: 0;
 }
 h1 a {
color: black;
text-decoration: none;
 }
 #background1 {
background-color:#09F;
height: 720px;
margin: 0px auto 0;
overflow: hidden;
position: relative;
width: 480px;
 }
 #background2 {
background-color:#09F;
height: 720px;
margin: 0px auto 0;
overflow: hidden;
position: relative;
width: 480px;
 }
 h4#time {
font-size: 18px;
text-align: center;
text-shadow: 0 -1px 0 #FFF;
padding-top: 4px;
 }
 .username {
    text-align: center;
text-shadow: 0 -1px 0 #000;
font-size: 26px;
color:#FFF;
padding-top: 5px;
 }
 #conversation {
padding-top: 15px;
 }
 h3#date {
color: #808080;
font: bold 26px Helvetica, Arial, sans-serif;
text-align: center;
 }
 p.message {
font: 22px/25px Helvetica, Arial, sans-serif;
 }
 .gBoxTall {
background-color:#0C0;
clear: both;
float: right;
margin-top: 15px;
max-width: 270px;
padding-left: 22px;
 }
 .gBoxTall .right {
background-color:#0C0;
 }
 .gBoxTall .right p {
margin-left: -5px;
padding: 8px 30px 0 0;
color:#000;
text-shadow: 0px 0px 0px;
 }
 .gBoxTall .bottom {
background-color:#0C0;
height: 20px;
margin: -10px 0 0 -22px;
 }
 .gBoxTall .bottom .right {
background-color:#0C0;
float: right;
height: 20px;
width: 43px;
 }
 .wBoxTall {
background-color:#999;
clear: both;
float: left;
margin-top: 15px;
max-width: 260px;
padding-left: 33px;
 }
 .wBoxTall .right {
background-color:#999;
 }
 .wBoxTall .right p {
margin-left: -5px;
padding: 8px 24px 0 0;
color:#000;
text-shadow: 0px 0px 0px;
 }
 .wBoxTall .bottom {
background-color:#999;
height: 20px;
margin: -10px 0 0 -33px;
 }
 .wBoxTall .bottom .right {
background-color:#999;
float: right;
height: 20px;
width: 27px;
 }
 #contentarea {
font-family: Helvetica, Arial, sans-serif;
height: 660px;
overflow: hidden;
 }


Your h4 tags are closed with h3 tags - this is invalid. Based on your CSS the line should probably be:

<h4 id="time">01:59 AM</h4><br/><h3 class="username">Enter a name..</h3><div id="conversation"><div class="gBoxTall">
0

精彩评论

暂无评论...
验证码 换一张
取 消