Using Css Selectors: The Type Selector

Using Css Selectors: The Type Selector

Over the last year I have been spending a lot of time re-learning how to use CSS. Since ASP.NET was released the use of Web Controls had made me CSS and HTML ignorant.

Over the last year I have been spending a lot of time re-learning how to use CSS. Since ASP.NET was released the use of Web Controls had made me CSS and HTML ignorant. With the advent of ASP.NET MVC and jQuery combined with the increasing demand for richer user experiences I knew I had to tackle this deficiency immediately. Hence my adventure into my Thin ASP.NET series. It took me a while because I just did not understand how CSS selectors actually work. When I started using jQuery it finally popped for me and I really started to get it. There are three fundamental CSS selectors that just about anyone that has done any web work understands, type, class and DOM Id.

The Type Selector

This should be the most obvious selector because it sets the default rule to be followed for the specified element (I really call them element selectors, but that is not technically correct, they are Type selectors). For example the following rule designates the text contained within a

element will be the size of the containing element's font size definition and the text's color will be black.


This is a good start. Today, sites that follow CSS best practices define a CSS Reset in the top of the file. Basically this is a set of rules that define the default layout behavior of those elements in the page. The driving reason behind this technique is to take control over the default rendering rules from the browser, hence eliminating many of the frustrating differences between browsers. Personally I have decided to adopt the YUI CSS Reset from Yahoo as my default reset, but there are many others available and of course you can define your own.


Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire CSS Developer

Want to develop a website or re-design using CSS Development? We build a website and we implemented CSS successfully if you are planning to **[Hire CSS Developer]( "Hire CSS Developer")**...

Creating a CSS Visual Cheatsheet

The other day one of our students asked about possibility of having a CSS cheatsheet to help to decide on the best suited approach when doing this or that layout.

7 Best Vue CSS Component for Your App

Vue CSS frameworks are great for many reasons; code is more universally understood, web applications are easier to maintain, and prototyping becomes less of an extra step.

Learn to use variables in CSS (CSS Tricks)

whats the variable in CSS, how to declare use them. Whats the benefit of variables in CSS. Lets learn all this. #Variables #CSS #HTML #CssVariables #ITArticles

CSS Flex Box: A Flexible Way To Layout

Every element of HTML is a rectangular box. Every Box has a defined height and width. This way you can increase or decrease its size.