Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to define inline css?

user-image
Question added by Mohammad Irfan , Certified Magento Developer , Xcite.com
Date Posted: 2013/10/08
Abdul Mannan
by 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