Basic Website Layout for Blogs in Css | no Js | Full Responsive

Introduction: In this blog post, we’ll explore the fundamental elements of creating a simple blog website using HTML and CSS. We’ll break down the code step by step, explaining each part in the simplest terms possible, making it easy for beginners to understand.

HTML Structure: Let’s start with the HTML structure of our blog website. HTML (Hypertext Markup Language) is the standard markup language for creating web pages. It provides the structure and content of the webpage. Here’s a breakdown of the HTML code:

  • <!DOCTYPE html>: This declaration specifies the document type and version of HTML being used.
  • <html lang=”en”>: This tag defines the root element of the HTML document and specifies the language of the content (in this case, English).
  • <head>: This section contains metadata about the document, such as the character set, viewport settings, and the title of the page.
  • <meta charset=”UTF-8″>: This meta tag specifies the character encoding for the document (UTF-8, which supports a wide range of characters).
  • <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>: This meta tag sets the viewport properties to control the page’s dimensions and scaling on different devices.
  • <title>: This tag defines the title of the webpage, which appears in the browser’s title bar or tab.
  • <style>: This tag contains CSS (Cascading Style Sheets) code for styling the HTML elements.
  • <body>: This section contains the visible content of the webpage, including the header, navigation, blog posts, and footer.

CSS Styling: CSS is used to style the HTML elements and make the webpage visually appealing. Let’s break down the CSS code used in our blog website:

  • body: Sets the font family, margin, padding, and background color for the entire webpage.
  • header: Styles the header section, including background color, text color, and padding.
  • nav: Styles the navigation bar, including background color, text color, and padding.
  • nav a: Styles the navigation links, setting the color and removing the underline.
  • .container: Styles the main content container, setting the maximum width, margin, padding, and overflow properties.
  • .post: Styles each individual blog post, including background color, margin, padding, border radius, and box shadow.
  • footer: Styles the footer section, including background color, text color, text alignment, padding, and fixed positioning at the bottom of the page.
  • @media: Uses media queries to apply specific CSS rules based on the device’s screen width. In this case, it adjusts the padding of the container for screens with a maximum width of 768 pixels.
 <!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Blog</title>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;

        header {
            background-color: #333;
            color: #fff;
            padding: 20px;
            text-align: center;

        nav {
            background-color: #666;
            color: #fff;
            padding: 10px;
            text-align: center;

        nav a {
            color: #fff;
            text-decoration: none;
            margin: 0 10px;

        .container {
            max-width: 960px;
            margin: 20px auto;
            padding: 0 20px;
            overflow: hidden;

        .post {
            background-color: #fff;
            margin-bottom: 20px;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        .post h2 {
            color: #333;

        .post p {
            color: #666;

        footer {
            background-color: #333;
            color: #fff;
            text-align: center;
            padding: 20px 0;
            position: fixed;
            width: 100%;
            bottom: 0;

        @media only screen and (max-width: 768px) {
            .container {
                padding: 0 10px;
        <h1>My Blog</h1>
        <a href="#">Home</a>
        <a href="#">About</a>
        <a href="#">Contact</a>
    <div class="container">
        <div class="post">
            <h2>Post Title</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eget justo nec odio tristique placerat. Suspendisse potenti. Fusce auctor ex sit amet ante aliquet, vitae dictum eros dapibus.</p>
        <div class="post">
            <h2>Post Title</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eget justo nec odio tristique placerat. Suspendisse potenti. Fusce auctor ex sit amet ante aliquet, vitae dictum eros dapibus.</p>
        © 2024 My Blog

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments

Let's Start Your Social Media Success Story Today!

At Ourgrid, we’re committed to helping you achieve your social media marketing goals. Whether you’re looking to boost brand awareness, drive engagement, or increase conversions, our team of experts is here to guide you.

Frequently Asked Questions

Have Questions About Our Social Media Marketing Services? We Have Answers!
What services does your web design agency offer?
  • Our agency specializes in a wide range of services including website design, development, UX/UI design, e-commerce solutions, mobile responsiveness optimization, SEO, and digital marketing strategies tailored to enhance online presence and engagement.
How do you approach the design process for a new website?

Our design process begins with comprehensive research and understanding of your business goals and target audience. We then proceed to wireframing, prototyping, and iterative design, ensuring constant communication and feedback loops with our clients to achieve the desired outcome effectively and efficiently.

What sets your agency apart from others in the industry?

Our agency stands out due to our commitment to delivering high-quality, customized solutions that are not only visually appealing but also functional and user-friendly. We prioritize collaboration with our clients throughout the entire project lifecycle, ensuring their vision is realized while also incorporating industry best practices and the latest design trends.

Can you provide examples of successful projects your agency has completed?

Certainly! We have a portfolio showcasing a diverse range of projects across various industries, each demonstrating our expertise in creating unique and impactful web experiences. From small businesses to large enterprises, our projects consistently deliver results that exceed expectations and drive measurable success.

How do you ensure websites are optimized for search engines (SEO)?

SEO optimization is an integral part of our design process. We employ best practices in website structuring, content creation, keyword research, and metadata optimization to ensure maximum visibility and ranking on search engine results pages. Additionally, we provide ongoing SEO maintenance and analytics tracking to continuously improve performance.

What is your approach to responsive design?

We prioritize responsive design to ensure that websites are accessible and perform well across all devices and screen sizes. Our approach involves utilizing flexible grids and layouts, fluid images, and CSS media queries to adapt the design seamlessly to different viewing environments, enhancing user experience and engagement.

How do you handle website maintenance and updates post-launch?

We offer comprehensive maintenance packages tailored to meet the specific needs of our clients. This includes regular backups, security updates, content updates, performance monitoring, and ongoing support to address any issues or enhancements required post-launch, ensuring the website remains secure, up-to-date, and optimized for continued success.

What is your process for measuring the success of a website after launch?

We utilize a combination of analytics tools and key performance indicators (KPIs) to assess the effectiveness and impact of the website post-launch. This includes tracking metrics such as traffic, engagement, conversion rates, and user behavior to identify areas for improvement and optimization, allowing us to continuously refine and enhance the website’s performance over time.

Empower Your Brand Captivating Audiences through marketing.

Copyright: © 2024 WordPress. All Rights Reserved.

Would love your thoughts, please comment.x
Verified by MonsterInsights