Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inline CSS using Jade templating system

Tags:

node.js

pug

Is there a way to write inline css using Jade for Node?

My HTML is:

<div class="column" style="text-align:center;"></div>

but I can't see any reference to this in the guides.

like image 275
tommyd456 Avatar asked May 10 '14 08:05

tommyd456


People also ask

How to use inline styles in HTML?

When you use inline styles, you add them directly to the HTML tags with the style attribute. For example, in our HTML code, we can assign a color to any of the paragraphs by writing the CSS right inside the opening tag. It is also typical to remove the default underline and color assigned to links, so we can do that inside the opening <a> tag too.

What is inline CSS and why is it bad?

Browsers always download the HTML, CSS, and JavaScript files before displaying a web page, so with inline CSS there are fewer files to be downloaded. Makes the HTML messy, harder to maintain, and less readable.

What is the best templating engine for JavaScript?

jQuery Templating. jQuery Templating provides all the necessary you are looking in a templating engine for JavaScript. It is a tool that you will find no trouble using. Not only that, it is fast, uses valid HTML5 and utilizes only pure HTML for templates.

What is the best way to style HTML code?

External Stylesheets in HTML This is considered the best way to style your HTML code. External stylesheets are totally separate from the HTML and you place them in a CSS file (with the.css extension). To use external stylesheets in your HTML, you link them within the head with the link tag.


1 Answers

You can write anything you want in HTML attributes:

.column(style="align:center;")
like image 159
Laurent Perrin Avatar answered Oct 10 '22 05:10

Laurent Perrin