DEV Community

Guru prasanna
Guru prasanna

Posted on

Day - 1 HTML/CSS - Project 1: ILUGC(web page)

HTML:

  • HTML stands for Hyper Text Markup Language
  • HTML is the standard markup language for creating Web pages
  • HTML describes the structure of a Web page
  • HTML consists of a series of elements
  • HTML elements tell the browser how to display the content
  • HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.

Refer- https://www.w3schools.com/Html/html_intro.asp

CSS:

  • Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML.
  • CSS describes how elements should be rendered on screen, on paper, in speech, or on other media.

Refer- https://developer.mozilla.org/en-US/docs/Web/CSS

Image description

Difference between HTML/CSS and Javascript.

-->HTML/CSS - Static pages - Content remains the same every time they are loaded unless manually updated.
-->Javascript - Dynamic pages - Pages can respond to user actions, such as clicking a button, submitting a form, or moving the mouse.

HTML Syntax:

<html>
<head>
<title>Page Title</title>
</head>
<body>
   <h1>My First Heading</h1>
   <p>My first paragraph.</p>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

-->Save the file with (.html) extension and double click to run the program.

Image description

HTML Element:
In HTML, elements are typically enclosed using an opening tag and a closing tag to define their start and end.
--> Opening Tag : Marks the beginning of an HTML element.
--> Closing Tag : Marks the end of an HTML element with forward slash before the element name.
Ex: <p>Hello, World!</p>

Standalone tag: A standalone tag (also known as a self-closing tag) in HTML is an element that does not require a closing tag because it does not have any content between an opening and a closing tag.
Ex- <br>- break:used to insert a line break

Project:

Preparing ILUGC web page layout:(https://ilugc.in/)

<html>
<head>
    <title>ILUGC</title>
<style>
.container{
    border:1px solid;
    height:200%;
    width:85%;
    margin:auto;
}
.header h4{
    text-transform: uppercase;
    color:#e22d30;
    border-top:1px solid green;
    width: fit-content;
    padding-top:10px;
}
.header{

    margin:25px;
}
</style>
</head>
<body>
   <div class="container">
        <div class="header">
            <h1>ILUGC</h1>
            <h4>Indian Linux User's Group - Chennai (Madras)</h4>
        </div>
        <div class="navbar">
        </div>
        <div class="layout">
           <div class= "mainLayout"> 
           </div> 
           <div class="sideLayout"> 
           </div>
        </div>
        <div class="footer">
        </div>
   </div> 
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Output:

Image description

Explanation:

  1. <html>: The root element of the HTML document.
  2. <head>: Contains metadata and resources for the document.
  3. <title>: Sets the title of the webpage displayed on the browser tab.
  4. <style>: Embeds CSS for styling the HTML document.
  • .container: Styles the container div:
    a) border: 1px solid;: Adds a 1-pixel solid border.
    b) height: 200%;: Sets the height to twice the viewport height.
    c) width: 85%;: Sets the width to 85% of the viewport width.
    d) margin: auto;: Centers the container horizontally.

  • .header h4: Styles the <h4> element inside the .header class:
    a) text-transform: uppercase;: Converts text to uppercase.
    b) color: #e22d30;: Sets the text color to a specific shade of red.
    c) border-top: 1px solid green;: Adds a green top border.
    d) width: fit-content;: Shrinks the element width to fit its content.
    e) padding-top: 10px;: Adds 10 pixels of padding above the text.

  • .header: Styles the header div:
    a) margin: 25px;: Adds a margin of 25 pixels around the header.

  1. <body>: Contains all the visible content of the webpage.
  2. <div>: A container element for grouping and styling content.
  3. <h1>: Represents the main heading of the webpage.
  4. <h4>: Represents a subheading of lesser importance than <h1>.

Attribute:
An attribute provides additional information about an HTML element, usually in the form of name-value pairs.
Ex: `<div class="navbar"> is a div element with a class attribute assigned the value "navbar" to apply specific styles or functionality.

Padding:
Padding is the space between the content of an element and its border. It creates an internal margin around the content, pushing the content away from the edges of the element.

Margin:
Margin is the space outside an element's border that separates it from other elements. It defines the external space between elements, creating distance around them.

class selector and an element selector:

  • The class selector targets HTML elements that have a specific class attribute, using a period (.) followed by the class name.
  • The element selector targets HTML elements directly by their tag name

Top comments (0)