1

I hope this could be answered. More details: I want to create extra spacing after the ::first-letter but when I add margin to it expands the border. I tried to find a solution and found ::after but that didn't work for me..

CSS used:

h2::first-letter {
font-size: 200%;
font-family: Times;
padding-left: 5px;
padding-right: 3px;
border:2px solid black;                                                 
}

h2{
    font-family:"Helvetica Neue",HelveticaNeue,Arial,sans-serif;
    font-weight:normal;
}

Any tips or improvements would be really great! I'm pretty new to it, but I learning it at a decent speed.

1 Answers1

0

You'll want to add a margin-right to your h2:first-letter declaration.

See this fiddle for an example.

h2::first-letter {
   font-size: 200%;
   font-family: Times;
   padding-left: 5px;
   padding-right: 5px;
   margin-right: 3px;
   border:2px solid black;                                                 
}
Singular1ty
  • 2,577
  • 1
  • 24
  • 39