0

I have come across the following problem: i wish to hide the "..." that are displayed within the .footer div after the link, as shown in the picture below.

Only caveat: I can only use CSS to do so.

Dev Tools Screenshot

Can anybody tell me how to achieve this please?

dippas
  • 58,591
  • 15
  • 114
  • 126
lolcat
  • 119
  • 10
  • To be helped you should post your full html (into eventually a snippet) ,that shows the issue, not a useless image :) .... if it is only about text, then font-size should do – G-Cyrillus Jan 12 '17 at 15:37
  • Possible duplicate of [Is there a CSS selector for text nodes?](http://stackoverflow.com/questions/5688712/is-there-a-css-selector-for-text-nodes) – Serlite Jan 12 '17 at 15:42

5 Answers5

2

you can use visibility:hidden in div parent and visibility: visible in child a

div {
  visibility: hidden
}
div a {
  visibility: visible
}
<div class="footer">
  <a href="#">All courses</a>
  ...
</div>

other approach is font-size:0

div {
  font-size: 0
}
div a {
  font-size: initial
}
<div class="footer">
  <a href="#">All courses</a>
  ...
</div>
dippas
  • 58,591
  • 15
  • 114
  • 126
1

From my comment about the use of font-size:

div {
  font-size: 0;
  border:solid;
}
div * {
  font-size: 1rem;
  margin:0.25em;
}
<div><a href="#">link to see</a> "text to hide "<a href="#">link to see</a>
  <p>some more text here</p>
   "Also some text to hide "
</div>
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
0

The only way I can think of hiding content within a div is using this although it will also hide everything else contained within the div. If this is not what you hope to achieve please elaborate more.

    .footer {
        visibility: hidden;
    }

    <div class="footer">
    "..."
    </div>
xfactor11
  • 11
  • 6
0

.wraper p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 1.3em;
  }
<div class="wraper">
  <a href="#">All courses</a>
  <p>&nbsp;Lorem ipsum</p>
</div>
Andrei Fedorov
  • 3,689
  • 2
  • 13
  • 25
-1

Use :not and a color property

.footer:not(a){
  color:rgba(0,0,0,0);
}

Edit: jsFiddle

Boris K
  • 1,469
  • 9
  • 29