0

Are the some way to put css inside html?, I mean for example but selectors like "before:" and "after:"

<div id="foto" style="position: relative; margin: 20px auto: with: 500px;heght:200px......">
<img src="imgt/big.jpg" width="500px" height="200px">
</div>

And this is the file css

#foto{
position: relative;
margin: 20px auto;
width: 500px;
height: 200px;
padding: 10px;
border: 1px solid #ccc;
background: #eee;
}
#foto:before{
content: "";
position: absolute;
z-index: -1;
left: 10px;
bottom: 15px;
width: 50%;
height: 20%;
box-shadow: 0 15px 10px rgba(0,0,0,0.7);
-webkit-transform: rotate(-3deg);
}
#foto:after{
content: "";
position: absolute;
z-index: -1;
left: 250px;
bottom: 15px;
width: 50%;
height: 20%;
box-shadow: 0px 15px 10px rgba(0,0,0,0.7);
-webkit-transform: rotate(5deg);

}

Kakitori
  • 901
  • 6
  • 16
  • 41

2 Answers2

3

You can use inline style as you have used for the div. But why do you need to do so ? Its always a better practice to keep css in a separate file.

As Zenith said you can't use pseudo-element in inline style. See this

Community
  • 1
  • 1
Vivek Sadh
  • 4,230
  • 3
  • 32
  • 49
0

it is always better to write your code in a separate file.you can use inline style but it becomes difficult to edit or make some changes later.And since you are so eager to use inline style why don`t you just write down your code in head tag.this way you code will be much more cleaner and you can access it in the same page.you have mentioned the inline style in your code.so you already know the answer to your question.