How to hide p1 within div


Tags: css

Problem :

How can I remove only one paragraph (p1) from a div? This is my complete html and css: http://jsfiddle.net/8Q3YH/

I want to remove p1 completely from the below.

<div id="quickSummary">
        <p class="p1"><span>A demonstration of what can be accomplished       visually through <acronym title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p>
        <p class="p2"><span>Download the sample <a href="zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a href="zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p>
    </div>


Solution :

with CSS you would do

#quickSummary .p1 { display:none; }

This hides the element with the class p1

you could use a pseudo class but it is not supported by all browsers yet

that would be

#quickSummary p:first-child { display:none; }

Which means, the first paragraph tag inside quickSummary will be hidden.

Hope this helps.


    CSS Howto..

    How to target images with dynamically generated ids with CSS

    How To Remove Wordpress Title From One Page?

    How to understand CSS Background-Position coordinates

    How can I make my div to remain fixed and no longer change position?

    JS+CSS How to display images from an array from top right to bottom left

    How do I use the alignment of one class and the font of another?

    How to properly style current_page_item based from theme

    How to make URL change upon clicking through AJAX loaded menu?

    How should I divide up CSS files to support multiple devices?

    How to pull all CSS rules on an element together

    How to apply css for a class within h2?

    How do I apply a css padding to one element but not its child

    How to correctly impose a background-color to a div wrapping article and aside in HTML/CSS?

    How to create an overlay to be used under a pop up

    How to make iframe use all height available to it

    HTML - How to do a square plain button while using jQuery Mobile css [closed]

    How do I change background color of li elements

    How can I adjust image width and height to 100 x 100 keeping ratio?

    How to set my Django form on the center of the page

    How to prevent automatic onmouseover after onfocus?

    Using CSS, how do you anchor an element to a baseline and size it based on another “pinned” element?

    How to change iframe src using css

    How to add the img-responsive class in javascript

    Background Image in WebView showing in Simulator, but not on Device

    How to create custom shapes with pseudo classes in CSS3

    How to build sliding horizontal menu. CSS

    How to disable css transition for specific line of css?

    How to refer to css file in codeigniter?

    How to change font-size of multiple elements using jQuery

    How to keep a navbar toggle open until selection is made