Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to define inline css?

user-image
Question ajoutée par Mohammad Irfan , Certified Magento Developer , Xcite.com
Date de publication: 2013/10/08
Abdul Mannan
par Abdul Mannan , Senior Software Engineer , Northbay Solutions

Well its quite simple to define the inline css. You can simply write the "style" tag. For example you have a div tag and you want to add the borders by using inline css.  Then you can do the following to acheive this.

 

<div style="border:1px solid #000;"></div>

 

Also you can add various style to that as well. But usaully the inline css is not a good practise. It makes it more difficult to recise the look of a website. For example if you are using the inline css for the things like 

<div style="font-weight:bold;text-align:center">Page Heading</div>

on each page to display the page title, then it would be difficult for you to change the style of the heading on each page. 

 

It would be lot easier to maintain it like 

<div class="your-class">Page title</div>

 

So you only need to define the css for that class in the stylesheet and it will be replicated to all Page Titles using that class.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?