javascript - Aligning four circle's inside a square in CSS and HTML5 -


I am developing a simulation size game, and I am working on all javascript etc.

Main I have problems with CSS; When you click it, everything works,

Here's a silent image that I want to see:

 Enter image details here

CSS:

  body {background-color : # 333; Color: #fff; } Ul {list-style: none; Margin: 0 20 px 0; Padding: 0; Text align: center; } Li {Display: Inline-Block; Padding: 3px; }. Wiper {status: relative; Width: 640px; Margin: 0 auto; }. Back {width: 700px; Height: 700px; Background color: black; } .pad {width: 200px; Height: 200 pixels; Z-index: 1; Margins: 10px; -M-filter: "Progress: DXimage Transforms. Microsoft. Elfa (Opacity = 60)"; Filters: alpha (opacity = 60); Opacity: 0.6; } .shape1 {status: absolute; Left: 0; Top: 50%; Margin-top: -300px; Width: 100px; Height: 100 pixels; Background color: green; Limit-Radius: 50%; } .shape2 {status: absolute; Left: 50%; Margin-left: -50px; Width: 100px; Height: 100 pixels; Background color: red; Limit-Radius: 50%; } .shape3 {status: absolute; Left: 0; Correct: 50%; Margin-right: -50px; Width: 100px; Height: 100 pixels; Background color: yellow; Limit-Radius: 50%; } .shape4 {status: absolute; Left: 0; Bottom: 50%; Margin-down: -50px; Width: 100px; Height: 100 pixels; Background color: blue; Limit-Radius: 50%; } .level, .score {width: 50%; Swim left; Text align: center; } .sButton {width: 30%; Margin: 0 auto; }. Start {width: 100%; Height: 30px; Text align: center; }   

HTML: & Lt; source src = "sound / ogg / sounds_01.ogg" type = "audio / og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; div class = "pad size 2" data-pad = "2" & gt; & Lt; Audio preload = "auto" class = "sound 2" & gt; & Lt; source src = "sounds / mp3 / sounds. 2. MP3" type = "audio / mpeg" /> & Lt; source src = "sound / ogg / sounds_02.ogg" type = "audio / og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; div class = "pad size 3" data-pad = "3" & gt; & Lt; Audio preload = "auto" class = "sound 3" & gt; & Lt; source src = "sound / MP3 / sounds 3. MP3" type = "audio / mpeg" /> & Lt; source src = "sound / ogg / sounds_03.ogg" type = "audio / og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; div class = "pad size 4" data-pad = "4" & gt; & Lt; Audio preload = "auto" class = "sound 4" & gt; & Lt; source src = "sound / MP3 / sounds 044. mp3" type = "audio / mpeg" /> & Lt; source src = "sound / ogg / sounds_04.ogg" type = "audio / og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; div class = "break" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; div class = "level" & gt; & Lt; H2 & gt; Level: 1 & lt; / H2 & gt; & Lt; / Div & gt; & Lt; div class = "score" & gt; & Lt; H2 & gt; Score: 0 & lt; / H2 & gt; & Lt; / Div & gt; & Lt; ul class = "difficulty" & gt; & Lt; Li & gt; & Lt; input type = "radio" class = "difOpt" name = "difficulty" value = "2" & gt; Easy & lt; / li & gt; & Lt; Li & gt; & Lt; input type = "radio" class = "difOpt" name = "difficulty" value = "1" checked & gt; General & lt; / li & gt; & Lt; Li & gt; & Lt; Input type = "radio" class = "different" name = "difficulty" value = "0.5" & gt; Hard & lt; / li & gt; & Lt; Li & gt; & Lt; input type = "radio" class = "difOpt" name = "difficulty" value = "0.25" & gt; Crazy & lt; / li & gt; & Lt; / Ul & gt; & Lt; Div class = "sButton" & gt; & Lt; Button class = "start" & gt; Start & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt;

You want to give your shape a complete position and "top", "left "," Right "and" Bottom "as the CSS properties:

  .shape1 {status: absolute; Left: 0; Top: 50%; Margin-top: -50px; Width: 100px; Height: 100 pixels; Background color: green; Limit-Radius: 50%; }   

Note that the margin-top is used to offset the "top" property slightly, the border-radius will turn them into circles.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -