Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is <div style="width: ;height: ;background: "> CSS?

Tags:

html

css

Is <div style="width: ;height: ;background: "> CSS?

like image 591
Noob Web Dev Avatar asked Nov 19 '16 07:11

Noob Web Dev


2 Answers

For example :

<div style="height:100px; width:100px; background:#000000"></div>

here.

you give css to div of height and width having 100px and background as black.

PS : try to avoid inline-css you can make external CSS and import in your html file.

you can refer here for CSS

hope this helps.

like image 86
Bhavin Shah Avatar answered Sep 19 '22 23:09

Bhavin Shah


Yes, it is called Inline CSS, Here you styling the div using some height, width, and background.

Here the example:

<div style="width:50px;height:50px;background color:red">

You can achieve same using Internal or External CSS

2.Internal CSS:

  <head>
    <style>
    div {
    height:50px;
    width:50px;
    background-color:red;
    foreground-color:white;
    }
    </style>
  </head>
  <body>
    <div></div>
  </body>

3.External CSS:

<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div></div>
</body>

style.css /external css file/

 div {
        height:50px;
        width:50px;
        background-color:red;
    }
like image 27
Sharavnan Kv Avatar answered Sep 21 '22 23:09

Sharavnan Kv