DEV Community

Dharshini E
Dharshini E

Posted on

Day 2 of my Java Full Stack learning Journey :HTML & CSS

Hi everyone!

what i learned Today :
layouts elements
In HTML,a layout refers to how elements are arranged on web page to create a user-friendly structure.
-<header>
-<nav>
-<section>
-<article>
-<aside>
-<footer>

CSS

Element Selector
An element selector is the most basic CSS selector that targets HTML elements by their tag name.also known as type selector.it selects all<p> elements and makes their text blue.
Syntax:

element{
property: value;
}
Enter fullscreen mode Exit fullscreen mode

Example:
p{
color:blue;
}

Two types of HTML Elements :

  • Block Elements
  • Inline E lements
    Block Elements:

  • Always start with new line.

  • it takes the full width of their parent by default.

  • You can set width and height.
    example:
    <p>,<h1> to <h6>,<div>,<ul>,<li>,<ol>,<section>,<article>,<nav>,<footer>.
    Inline Elements:

  • Do not start with new line .

  • only take up as much width as needed.

  • you cannot set width or height directly.
    example:
    <span>,<a>,<strong>,<em>,<img>,<label>,<input>.
    Comments:
    HTML- <!-- comments -->
    CSS- /* comments */

List Styling:
two types of list styling:

  • odered list (<ol>)
  • unodered list (<ul>)
    Odered List

  • Items are numbered by default.

  • used when oder matters

example:


<ol>
<li>Wake up</li>
<li>Brush</li>
<ol>
Enter fullscreen mode Exit fullscreen mode

Output:
1.Wake up
2.Brush
unodered list

  • items have bullets by default.
  • used when the oder doesn't matter.

example:

<ul>
<li>Wake up</li>
<li>Brush</li>
<ul>
Enter fullscreen mode Exit fullscreen mode

Output:

  • Wake up
  • Brush
    Anchor Tag

  • it is used to create hyperlinks in HTML.

  • it allows users to click and go to another page ,website,section,or file.

Syntax:

<a href="url">link Text</a>
Enter fullscreen mode Exit fullscreen mode
  • href : hyperlink reference.
  • url:

  • a website

  • a page in your site

  • a file

  • an id on the same page
    Final Thoughts:

Today i learned a lot and I'm even more excited for tomorrow's topic. Happy Codding!

Top comments (0)