cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">  

<div class="parent">
  <div class="container">
    <h3>::first-line</h3>
    <p class="exemple1">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum.
    </p>    
  </div>
  
  <div class="container">
    <h3>::first-letter</h3>
    <p class="exemple2">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
    <p class="exemple2">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
    </p>    
  </div>
  
  <div class="container">
    <h3>::before & ::after</h3>
    <div class="line">
      <span>Ajout d'icône à un label</span>
      <div class="exemple3">Click me</div>
    </div>
    
    <div class="line">
      <span>flèche sur un div</span>
      <div class="exemple4">Click me</div>
    </div>
    
    <div class="line">
      <a href="https://css-tricks.com/pseudo-element-roundup/">Autres exemples</a>
    </div>
  </div>
  
</div>
            
          
!
            
              .parent {
  display: flex;  
  background-color: #e8e8e8;
  width: 100vw;
  height: 100vw;
  font-family: arial;
  font-size: 14px;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 18%;
  margin: 20px;
  background-color: white;
  height: 180px;
  border-radius: 2px;
  box-shadow: 0 2px 2px 1.16px rgba(0,0,0,0.2);
}

.line {
  margin-top: 5px;
  margin-bottom: 5px;
}

h3 {
  margin-top: 0px;
  margin-bottom: 5px;
}

.exemple1, .exemple2 {
  text-align: justify;
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 0px;
}

.exemple1::first-line {
  font-size: 18px;
  font-weight: bold;
}

.exemple2::first-letter {
  font-size: 18px;
  font-weight: bold;
  margin-left: 20px;
}

.exemple3 {
  display: inline-block;
  background-color: blue;
  border: none;
  padding: 5px;
  border-radius: 2px;
  color: white;
  cursor: pointer;
  text-align: center;
  width: 80px;
}

.exemple3:hover {
  background-color: darkBlue;
}

.exemple3::before {
  font: normal normal normal 14px/1 FontAwesome;
  content: "\f245";
  padding-right: 10px;
}

.exemple4 {
  display: inline-block;
  background-color: blue;
  border: none;
  height: 30px;
  line-height: 30px;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  color: white;
  cursor: pointer;
  text-align: center;
  width: 80px;
  position: relative;
}

.exemple4:hover {
  background-color: darkBlue;
}

.exemple4::after {
  content: " ";
  position: absolute;
  right: -20px;
  top: 0px;
  border-left: solid 10px blue;
  border-top: solid 15px transparent;
  border-right: solid 10px transparent;
  border-bottom: solid 15px transparent;
}

.exemple4:hover::after {
  border-left: solid 10px darkBlue;
}
            
          
!
999px
Loading ..................

Console