AeJey
AeJey

Reputation: 1457

How can we disable default browser style properties for elements?

Having issue in design on forms and links on a page I created because of the browser style properties. How can I disable it so that no elements in my html page gets affected by the browsers' default style property?

All solutions are welcome. I am using php for development. So all solutions with css, javascript, php etc are welcomed.

Upvotes: 3

Views: 5008

Answers (5)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201588

You cannot disable browser default style sheets, just override them by setting properties to specific values. It is common to confuse the two.

This is a decision by browser vendors. They could give a page (scripts on a page) access to the browser’s stylesheet allowing it or parts thereof to be disabled. But they haven’t done that.

Upvotes: 1

abir_maiti
abir_maiti

Reputation: 490

You need to override browser's default stylesheet. You can do it many ways-

  • Manually define every elements style
  • Use any reset.css (You can find many)
  • Use a basic html startup tamplate, which covers everything you need. You can find one here, It has many options to choose from.

Hope you will love it :-)

Upvotes: 1

LogPi
LogPi

Reputation: 706

Please use normalize css :

http://necolas.github.io/normalize.css/

It'll help you.

Upvotes: 1

Pablo Lozano
Pablo Lozano

Reputation: 10342

There must be a default style for all elements, so you cannot just disable them. The usual way to handle this issue is adding your desired defaults in a base CSS file, overwriting the browser's defaults.

As @link commented, http://www.cssreset.com/ provides several default styles to be applied as base in your pages.

Upvotes: 1

jordy korsten
jordy korsten

Reputation: 170

You can maybe put !important behind the css you want to overwrite the default style properties?

maybe this solves your solution?

Upvotes: 2

Related Questions