1. Home
  2. Explore
  3. Computer Science
  4. Website with HTML & CSS

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Website with HTML & CSS

Speaker 1Speaker 2

Website with HTML & CSS

7:10
0:00-7:10
  1. Hope

    Alright, let's build a complete website using only HTML and CSS. This is perfect for beginners, and we can use it for business, personal projects, or even a college assignment. Where should we start?

  2. Michael

    First, we set up our project folder. Create a folder called 'website', add a background image inside it, then open VS Code and select that folder. Inside, create two files: index.html for the structure and style.css for the styling. Simple enough.

  3. Hope

    Exactly. And inside the HTML, we start with the basic structure. We name the page 'Webpage Design' and link the CSS file. Then we create a div with class 'main'—that's going to be the container for everything.

  4. Michael

    Inside that main div, we add a navigation bar. We use another div with class 'navbar', and inside that, an 'icon' div for the logo. The logo text is 'PraRoz' with a class 'logo'. Let's check it in the browser—there's our logo, but it's not styled yet.

  5. Hope

    Right, so now we go to the CSS. First, we reset margins and padding to zero on everything. Then for the 'main' class, we set width to 100%, height to 100vh, and use a linear gradient background—this makes the background image 50% dimmer. We add the background image via url and set it to cover and center. That gives a nice full-screen background.

  6. Michael

    That looks great. Now for the navbar: we give it a width of 1200px, height 75px, and margin auto to center it. The 'icon' div gets width 200px, float left, height 70px. Then the logo gets an orange color, font-size 35px, Arial font, padding left 20px, float left, and padding top 10px.

  7. Hope

    Now we need the menu. Back in the HTML, we add another div with class 'menu' and inside an unordered list. Each list item has an anchor tag. We create links for Home, About, Service, Design, and Contact. Then in the CSS, we style the menu div with width 400px, float left, height 70px. For the list, we set list-style none, display flex, justify-content center, align-items center. Then for each list item, we add margin left 62px, margin top 27px, font-size 14px. The anchor tags get text-decoration none, color white, font-family Arial, font-weight bold, and a transition of 0.4s ease-in-out.

  8. Michael

    And for the hover effect, we change the color to orange when you hover over a menu item. That gives a nice interactive feel. Then we add a search bar: another div with class 'search', an input of type text with placeholder 'Type to text', class 'srch', and an anchor tag with class 'btn' that says 'Search'. In CSS, the search div gets width 330px, float left, margin left 270px. The input gets font-family Times New Roman, width 200px, height 40px, transparent background, border 1px solid orange, margin top 13px, color white, font-size 16px, padding 10px, border-radius 5px. The button gets width 100px, height 40px, background orange, border 2px solid orange, margin top 13px, color white, font-size 15px, border-radius 5px. Also, we remove outlines on focus for both.

  9. Hope

    Now we add the main content section. In the HTML, we create a div with class 'content'. Inside, an h1 tag says 'Web Design & Development Course' with a line break after 'Design'. Then a paragraph with some dummy text, and a link button 'JOIN US' with class 'btnn' and a 'cn' class. In CSS, we style the content div with width 100%, height auto, margin auto, color white, position relative. For the paragraph, padding-left 20px, padding-bottom 25px, font-family Arial, letter-spacing 1.2px, line-height 30px. The h1 gets font-family Times New Roman, font-size 50px, padding-left 20px, margin-top 9%, letter-spacing 2px. The 'JOIN US' button gets width 160px, height 40px, background orange, border none, margin-bottom 10px, margin-left 20px, font-size 18px, border-radius 10px, cursor pointer. And we remove underline on the link with text-decoration none, color black, transition 0.3s, and a hover effect that changes background to white.

  10. Michael

    For emphasis, we can make the word 'Development' in the heading orange by wrapping it in a span with class 'development' and styling it with color orange and font-size 60px. That makes it pop. Now let's build a login box on the right side. In the HTML, we create a div with class 'form'. Inside, an h2 says 'Login Here', then an input for email, one for password, a button with class 'btnn' that says 'Login', and a paragraph with 'Don't have an account' and a 'Sign up' link. Another paragraph says 'Log in with' and then some social media icons.

  11. Hope

    Styling the login box: we set width 250px, height 380px, background linear gradient to top (same as main), position absolute, top -20px, left 870px, border-radius 10px, padding 25px. The h2 gets width 220px, font-family sans-serif, text-align center, color orange, background white, font-size 22px, border-radius 10px, margin 2px, padding 8px. The inputs get width 240px, height 35px, transparent background, border-bottom 1px solid orange, no other borders, color white, font-size 15px, letter-spacing 1px, margin-top 30px, font-family sans-serif. On focus, outline none. Placeholder gets color white and font-family Arial. The login button gets width 240px, height 40px, background orange, border none, margin-top 30px, font-size 18px, border-radius 10px, cursor pointer, color white. Hover: background white, color orange. The link 'Sign up' gets text-decoration none, color black, font-weight bold. The paragraph 'Log in with' has font-family Arial, font-size 17px, padding-top 20px, text-align center. And the social media icons we add later.

  12. Michael

    We also need to fix the sign-up link: the closing anchor tag should be after 'Sign up' so it’s properly highlighted. Now for the social icons, we use an external icon library. We copy a script link from the video description and paste it in the HTML. Then we add anchor tags with class 'icons' and each has an 'ion-icon' attribute for Facebook, Instagram, Twitter, Google, and Skype. In CSS, we style these icons with text-decoration none, color white, font-size 30px, padding-left 14px, padding-top 5px. Hover effect changes color to orange with a transition of 0.3s.

  13. Hope

    And that's it! We've built a complete, styled website with a background, navigation bar, search bar, content section, login form, and social media icons. All using just HTML and CSS. It's clean, functional, and a great project for beginners.

  14. Michael

    Absolutely. The key takeaway is how we used floats for layout, positioning for the login box, and simple CSS properties like gradients, transitions, and hovers to make it look polished. And we did it step by step. Thanks for following along—be sure to like and subscribe, and drop any questions in the comments!

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent