How can I set first element to display: none;?


Tags: css,wordpress,iframe,pseudo-element

Problem :

So I'm styling this posttype in Wordpress, and when the user links to a soundcloud track that track will show in the post header. Now, if that user posts more than one link I'd like the next ones to be in the content of the post, excluding the first one which already appears in the header.

This is what rougly is output:

<div class="content">
    <p><iframe/></p>
    <p><iframe/></p>
    <p><iframe/></p>
    <p><iframe/></p>
</div>

How do I style this in CSS so only the last three iframes displays?

Michael



Solution :

Try this:

.content:first-child{
    display: none;
}

    CSS Howto..

    How can I give each
  • its own bullet image?
  • Something in my CSS is causing a random white bar to appear, how do I fix it?

    How to define absolute positioned element's anchor point?

    How to get 'hover' and 'active' states working with CSS and HTML?

    How to change checkbox's border style in CSS?

    How to incorporate specific CSS files for Responsive Design for Desktop and Mobile Browsers

    How can i override the margin: 0; padding: 0; border: 0; css styles from main body css for ul li

    What is the best CSS trick to reduce how much HTML you need?

    CSS: How to center a bottom-fixed menu

    JavaFX how to apply CSS theme

    CSS how to change text color of disabled option inside a select?

    How to make a CSS rule which applied on a div affect another div?

    how to overwrite button's non-hover state colour to grey, but when hover button show the colour (with css framework)

    How to vertically align in the middle a clickable image (between ) inside a div in a responsive manner?

    Use like this <div class="accounts"> <a href="LinkA" target="_blank"><img src="Vendors/Images/GithubLogo.png" alt="Github"></a> </div> <div class="accounts"> <a href="LinkB" target="_blank"><img src="Vendors/Images/SOLogo.png" alt="Stack Overflow"></a> </div> ...
    Read more

    How does CSS handle specificity tie?

    How to tooltip keep active using HTML and CSS or Jquery?

    asp .net: how to change css on span tag in c#

    How to create class in a custom CSS file by JavaScript?

    How to keep grid width if colums are switched in column menu

    How to increase constant space between li inline-block list elemets?

    How to transform xPath to CSS Selector

    Need help understanding how to format inline CSS of Table data from a JS file

    How to create vertical text using only CSS?

    How to force margins to be ready from js before document ready

    How to force text to wrap inside inline-block div?

    How can i prevent divs from moving while resizing the page

    How to load specific set css commands only at the first browsing of the web site?

    HTML/CSS: how to force text within a tag to be styled with font-style: italic !important;

    How to align stacked Font-Awesome icons correctly

    CSS/HTML problem in IE - how to fix?