Someone asked how to accomplish a certain design element via a widget. When I mentioned that they can add some div tags to their widget, they told me that they only use CSS in widgets.
Is there a problem using HTML in a widget? I've always used CSS and HTML in my widgets and have never heard that you shouldn't do this. But if I'm wrong, please let me know, and I'd like to know why.
You're right. I use HTML in text widgets all the time. I'd actually be less likely to use CSS in a widget.
I'm sure there are widgets for various plugins and things that may get pretty well messed up by throwing HTML in, and with others you may find that they strip out your HTML.
But yes, it's very possible. Just avoid putting PHP in there.
Dave Chu · Custom WordPress Developer – likes collaborating with Designers
Awesome, that's what I wanted to know. Thanks. I use text widgets quite a bit, so this surprised me when someone said this to me. Whew!
The chicken is relieved. I repeat. The chicken is relieved!
The topic ‘CSS, HTML and Widgets’ is closed to new replies.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!