Simon Willison’s Weblog

Subscribe

Why can’t I do style=“padding: 20px” and a border in the same div?

11th November 2013

My answer to Why can’t I do style=“padding: 20px” and a border in the same div? on Quora

You can’t have two style attributes on the same element—but you can have two styles rules inside the same attribute. Try this instead:

<div id="secondcontent" style="padding:20px; border:solid">

This is Why can’t I do style=“padding: 20px” and a border in the same div? by Simon Willison, posted on 11th November 2013.

Next: Is there any way to generate thumbnails of web links like Facebook generates when we paste a link in status or comment?

Previous: How many YC companies have tech co-founders?

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe