Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Css #182

Open
monarosej opened this issue Oct 1, 2024 · 1 comment
Open

Css #182

monarosej opened this issue Oct 1, 2024 · 1 comment

Comments

@monarosej
Copy link

monarosej commented Oct 1, 2024

Textual comments in CSS style sheets are similar to those in the C programming language.

body {
font-size: 62.5% /* 1em = 10px */
}

The stuff inside the/* */ marks are CSS comments.

Embedded styles are placed within the head element and use the style element. Embedded styles affect every instance of the element specified.

Inline styles, as you may have guessed, are placed inside elements within the body of an HTML document. Using the attribute "style", any element can be affected.

A style sheet gives the user several benefits:

  1. better control over layout.
  2. better control over text display.
  3. seperate form from structure.
  4. better site maintainability.
  5. smaller Web pages which means faster downloads.

CSS has the ability to explicitly control the status of underlining for an element - even for hyperlinks.

The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#".

@sakshamA200
Copy link

CSS (Cascading Style Sheets) is used to style the layout of web pages. It controls how HTML elements are displayed, including colors, fonts, and spacing.

To create CSS code, you can:

  • Create an external CSS file (with the extension .css) and link it to the HTML using the <link> tag in the <head>.
  • You can also use internal or inline which not recommended for better readability

-- Here's an example of an external CSS :

-- And this is how you can create the css code aka syntax

body {
background-color: lightblue;
}

h1 {
color: navy;
font-family: Arial, sans-serif;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants