Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Can I apply style for visible html elements using only CSS?

I want to apply CSS to only visible html dt and dd elements in following example

 

<div style="vertical-align: top">
                <ul class="list-inner">
                    <dt class=" result-label onlaod-hidden">
                        <label>Name: </label>
                    </dt>
                    <dd class="result-input onlaod-hidden">
                            <asp:TextBox ID="txtProductName " runat="server" />
                    </dd>
                     <dt class=" result-label onlaod-hidden">
                        <label>Price: </label>
                    </dt>
                    <dd class="result-input onlaod-hidden">
                            <asp:TextBox ID="txtPrice" runat="server" />
                    </dd>
 
</dl>
</div

Answers


This one is not recommended, but you can try following code

ul dt[style*="display:inline"]
ul dd[style*="display:inline"] 
{
    /*your css rules*/
}

 Here you can try “Blcok” property if you are using block Property in CSS

ul dt[style*="display:block"]
ul dd[style*="display:block "] {
    /*your css rules*/

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.