简体   繁体   中英

Hide a div by data-role attribute with CSS

I have searched for this answer to no avail. If a div exists as such: div[data-role="form-footer"]

What is the best way to hide this, and is it possible by CSS?

I have attempted to use, to no avail (I believe because the form div is being inserted through a script):

#form div[data-role="form-footer"] {
   display: none !important;
}  

The data-roll appears on the web version of the site only. In the code, it is inserted through script tags

I don't have enough "reputation" to comment. Yes it is possible with CSS Just use

display:none;

To hide any element. Example:-

div[data-role="form-footer"]{
display:none;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM