I was wondering if I can select a div
when it has an input
field as a child.
Here is the HTML I am using:
<div class="xxx">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">my title</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-5">some content</div>
<div class="col.md-7">some content</div>
</div>
<div class="row">
<div class="col-md-5">some content</div>
<div class="col-md-3">
<input type="text" class="form-control" id="date" />
</div>
</div>
</div>
</div>
</div>
Bootstrap adds a padding and margin to all div
blocks if they have col-* classes. What I want to achieve is that, if a div
contains an input
field, then the margin and padding should be set to 0px.
So the main question is: "Can I select a div according to his content?"
I have tried div[class*="..."]
and div[class^="..."]
, but neither is solving my problem.