css framework assignment'
css framework assignment'
1. Bootstrap: A widely used framework known for its responsive grid system, pre-built
components, and extensive documentation.
2. Foundation: Another popular framework offering a similar approach to Bootstrap, with
a focus on flexibility and customization.
3. Bulma: A modern framework built with Sass, known for its clean and modular design,
as well as its responsive grid system.
4. Materialize: A framework inspired by Google's Material Design principles, providing a
consistent and visually appealing user interface.
5. Semantic UI: A framework that uses human-readable class names, making it easier to
understand and maintain your code.
CSS frameworks are pre-built collections of CSS styles that can be applied to a
website to create a consistent and visually appealing design. They often include
components like buttons, grids, forms, and navigation menus, as well as typography
and color schemes.
How they work:
1. Import the framework: You add a link to the framework's CSS file to your HTML
document.
2. Use predefined classes: The framework provides classes that you can apply to HTML
elements to style them according to the framework's design. For example, you might
use btn for a button, container for a responsive container, or card for a card-like
element.
3. Customize: While frameworks provide a starting point, you can often customize their
styles using CSS overrides or by creating your own custom components.
Benefits of using CSS frameworks:
Save time: Frameworks can significantly speed up development by providing pre-built
components and styles.
Consistency: They help ensure a consistent look and feel across different pages of a
website.
Responsiveness: Many frameworks are designed to be responsive, meaning they
adjust to different screen sizes.
Accessibility: Frameworks often include features to improve accessibility for users with
disabilities.
Popular CSS frameworks:
Bootstrap
Foundation
Bulma
Materialize
Semantic UI
By understanding how CSS frameworks work and choosing the right one for your
project, you can create visually appealing and functional websites more efficiently.
1. Inline styles: Styles defined directly within an HTML element using the style attribute
have the highest specificity.
2. Internal styles: Styles defined within a <style> tag in the same HTML document have
a lower specificity than inline styles but higher than external styles.
3. External styles: Styles defined in external CSS files linked to the HTML document
have the lowest specificity.
Within each of these categories, the specificity is further determined by the number of
selectors involved in the rule. For example, a rule with a more complex selector (e.g.,
#my-element.class1.class2) will have higher specificity than a rule with a simpler
Element Specificity
Example:
HTML
<style>
p {
color: blue;
}
</style>
In this example, the paragraph will be displayed in red because the inline style has
higher specificity than the internal style.