Skip to main content

How to Create Solar System Using HTML & CSS

 

#solar #system #panel #blog #html #css #foryou #world #happy # website #webdesign #webdeveloper #how to #howto #trending #viral #srilanka #youtube #tiktok #blog  #howtocreate #Javascript #image #imageuploader

🌟 Explore the Universe: Building a Solar System with HTML and CSS! 🌟 Welcome to another mind-blowing adventure on @Coding With Nexus ! 🚀 Join us as we embark on an interstellar journey to create our very own solar system using nothing but HTML and CSS. 🌌

First Create a New Folder, Then

1.Open the folder in Vs Code
2.Create index.html and style.css Files
3.Begin Coding 

index.html


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Solar System</title>
</head>
<body>
    <div class="container">
        <div class="sun"></div>
        <div class="earth">
            <div class="moon"></div>
        </div>
    </div>
</body>
</html>



style.css

body{
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #070e17;
    overflow: hidden;
}
.container{
    font-size: 10px;
    width: 40em;
    height: 40em;
    position: relative;
}
.sun{
    position: absolute;
    top: 15em;
    left: 15em;
    width: 10em;
    height: 10em;
    border-radius: 50%;
    box-shadow: 0 0 3em white;
}
.earth , .moon{
    position: absolute;
    border-style: solid;
    border-color: white transparent transparent transparent;
    border-radius: 0.1em 0.1em 0;
    border-radius: 50%;

}
.earth{
    top: 5em;
    left: 5em;
    width:30em ;
    height: 30em;
    animation: orbit 36.5s linear infinite;
}
.moon{
    top: 0;
    right: 0;
    width: 8em;
    height: 8em;
    animation:  orbit 2.7s linear infinite;

}
.earth::before, .moon::before{
    content: '';
    position: absolute;
    border-radius: 50%;
}
.earth::before{
    top:2.8em ;
    right:2.8em;
    width: 3em;
    height: 3em;
    background-color: #34A56f;

}
.moon::before{
    top: 0.8em;
    right: 0.2em;
    width: 1.2em;
    height: 1.2em;
    background-color:#88aea3 ;
}
@keyframes orbit{
    to{
        transform:rotate(360deg) ;
    }
}

Comments

Popular posts from this blog

How to Create Animate Mic Logo

    Embark on a design and coding adventure with our tutorial on creating and animating a microphone logo using HTML and CSS. In this concise yet comprehensive guide, we'll navigate logo design principles, emphasizing simplicity and visual balance. Seamlessly transitioning to animation, we'll bring the mic logo to life, making it dynamic and engaging. What sets this tutorial apart is its accessibility—no complex software, just the power of code.🎙️✨ #logoanimation #designtutorial #webdevelopment Don't forget to like, share, and subscribe for more web development tutorials and tips. If you have any questions or need further assistance, feel free to leave a comment, and we'll be happy to help you out. Happy coding! Like Us On Facebook:    / codingwithnexusofficial   Follow Us On Instagram:    / coding_with_nexus   Follow Us On TikTok:    / coding.with.nexus  index.html <! DOCTYPE html > < ...

How to Create a Portfolio Web Site

    Unlock the power of web development with our step-by-step guide on building a stunning portfolio website using HTML and CSS! 🚀 Join us on this hands-on journey as we demystify the coding process, This video helps you craft a professional portfolio. Whether you're a beginner or looking to enhance your web development skills, this tutorial is your gateway to creating a standout digital presence. Elevate your portfolio game and showcase your talents to the world! 💻✨ index.html   <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < link rel = "stylesheet" href = "style.css" >     < script src = "https://kit.fontawesome.com/b186863b7d.js"     crossorigin = "anonymous" ></ script >     < title > Portfolio Website </ title >...

Create Cool Hover Effects for Cards with HTML & CSS (2024)

  Learn how to create stylish hover effects for cards using HTML and CSS in this tutorial. Watch step-by-step as we implement eye-catching animations to make your website's cards stand out. Perfect for web developers looking to enhance user experience and add a touch of interactivity to their projects. Get ready to impress with cool hover effects for cards!  Stay tuned for more web development tutorials. index.html  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Card </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < div class = "card" >         < img src = "Image/paris_eiffeltower_ssk500.jpeg" alt = "EiffelTower" >         < div class = "...