2016-05-13 14 views
1

Ich lernte Css in W3 Schule und ich habe gerade eine Seite, wo es funktioniert als was ich will, aber wenn ich inspect Element/am Telefon/andere Gerät mit kleineren Bildschirm verwenden, ist es unregelmäßig, vor allem auf den Text, ich weiß nicht, wo ich verpasst haben, hier ist mein Code:Auto Größe ändern Größe im Telefon und andere Bildschirmgröße

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
<style> 
 
/* Here You Put Code */ 
 
body { 
 
background-image:url("http://1.bp.blogspot.com/-CYQ5F9q6YlE/VIX6zgIg8EI/AAAAAAAAGwU/nkOudSDpI18/s1600/website-background-rough-surface.jpg"); 
 
} 
 
div { 
 
margin:30px; 
 
margin-top:20px; 
 
} 
 
.NODDOS { 
 
font-size:60px; 
 
position:absolute; 
 
border:2px solid black; 
 
box-shadow: 10px 10px 5px #888888; 
 
padding:160px; 
 
padding-top:50px; 
 
padding-bottom:50px; 
 
width:65%; 
 
font-weight:bold; 
 
} 
 
.abcdefg { 
 
font-size:30px; 
 
} 
 
.DONOTHACKUS { 
 
position:absolute; 
 
margin:30px; 
 
margin-top:310px; 
 
margin-left:20px; 
 
} 
 
.DONOTHACK { 
 
font-size:20px; 
 
color:black; 
 
background:; 
 
border:3px solid black; 
 
padding:10px; 
 
box-shadow: 4px 4px 5px #888888; 
 
text-decoration:none; 
 
} 
 
#home { 
 
background : #C2DFFF; 
 
} 
 
.DONOTHACK:hover { 
 
position: relative; 
 
top: -1px; 
 
box-shadow: 4px 4px 5px #888888; 
 
} 
 
.DONOTHACK a.hahaha { 
 
text-decoration: none; 
 
color:#000000; 
 
} 
 
.DONOTHACK a.hahaha:link { 
 
text-decoration: none; 
 
color:#000000; 
 
} 
 
.DONOTHACK a.hahaha:visited { 
 
text-decoration: none; 
 
color:#000000; 
 
} 
 
.DONOTHACK a.hahaha:active { 
 
color:blue; 
 
} 
 
.maybeimtooshy { 
 
font-size:50px; 
 
font-weight:bold; 
 
} 
 
.butimustkeeptry { 
 
position:absolute; 
 
margin-left:310px; 
 
margin-top:350px; 
 
} 
 
.totalkwithher { 
 
font-size:20px; 
 
} 
 
.alltime { 
 
position:absolute; 
 
margin-top:600px; 
 
border-bottom:5px solid black; 
 
width:94%; 
 
} 
 
.keeptryjustrun { 
 
position:absolute; 
 
margin-top:595px; 
 
margin-left:100px; 
 
font-weight:bold; 
 
font-size:50px; 
 

 
} 
 
.keeptrynoshy { 
 
font-weight:normal; 
 
font-size:30px; 
 

 
} 
 
.ihopeshewillloveme { 
 
height:50px; 
 
width:300px; 
 
} 
 

 
/*-------------------*/ 
 
<!-- Mazaya Salma Zhafarina --> 
 
<!-- I Love You    --> 
 
</style> 
 
</head> 
 
<body> 
 
<div> 
 
<div class="NODDOS">English Lesson 
 
<p class="abcdefg">Welcome To English Lesson !</p> 
 
</div> 
 
<div class="DONOTHACKUS"> 
 
<div class="DONOTHACK" id="home"><a class="hahaha" href="#">Home</a></div> 
 
<div class="DONOTHACK"><a class="hahaha" href="#">Tentang</a></div> 
 
<div class="DONOTHACK"><a class="hahaha" href="#">Kerjakan Soal</a></div> 
 
</div> 
 
<div class="butimustkeeptry"> 
 
<div class="maybeimtooshy"> 
 
Siapa Kita ? 
 
</div> 
 
<p class="totalkwithher"> 
 
Kita adalah anggota SMP 13 Semarang yang membuat website ini untuk melatih kemampuan siswa 
 
<p class="totalkwithher"> 
 
dalam berbahasa inggris melalui soal soal yang diberikan 
 
</p> 
 
</div> 
 
</div> 
 
<div class="keeptryjustrun"> 
 
Daftar Sekarang ! 
 
<p class="keeptrynoshy">Ayo Daftar Sekarang Dan Kerjakan Soal Untuk Menjadi Yang Terbaik !</p> 
 
<button class="ihopeshewillloveme" href="#">Daftar Disini !</button> 
 
</div> 
 
</div> 
 
</body> 
 
</html>

jemand wissen, wo im verpasst? -EDIT- fixiert ein Wort

+0

Was bedeutet "vermasselt"? Wenn Sie uns das spezifische Problem nicht mitteilen, können wir Ihnen nicht helfen. – Shaggy

+0

Durcheinander gemittelt unregelmäßig, auch das Problem im Text – diwang

+0

Wenn diese Namen für Klassen real sind, dann sollten Sie sie wahrscheinlich ändern, weil diese Namen Ihnen nichts darüber sagen, was sie tun, und deshalb sind sie schlechte Namen. – Dacaspex

Antwort

0

Es gibt viel zu tun ... Zunächst einmal müssen Sie dies in Ihrem head Tag legen:

<meta name="viewport" content="width=device-width, initial-scale=1.0"> 

Es stellt sicher, mobile Geräte nicht nur Machen Sie Ihre Desktop-Site kleiner (dh unlesbar ohne Zoomen).

Als nächstes müssen Sie "Medienanfragen" in Ihrem CSS, wie:

@media only screen and (max-width: 960px) { 
    ... 
    [ put CSS rules for screens below 960px width in here ] 
    ... 
} 

Sie mehrere Medienabfragen verwenden können, für Tablets, Smartphones in verschiedenen Größen usw.

Dies ist wesentlicher Teil - es ist eine Menge Arbeit ...

+0

jetzt wo die medienabfragen setzen ? – diwang

+0

nvm ich dies als nützlich markieren und lernen lernen :) – diwang

+0

Am unteren Rand Ihres CSS-Code, in Ihrem Fall innerhalb der '') – Johannes

0

es ist zu lang, um den gesamten Code zu lösen. Ich schlage vor, Bootstrap in Ihrem Code zu verwenden. Für einen Anfänger ist es am einfachsten, responsives Design zu lernen. finden Sie unter diesem Link Bootstrap Getting started page

Verwandte Themen