Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help with div - make div fit the remaining width

Tags:

css

I have the following html code:

<div class="a">
    <div class="b">
        <a href="#">text</a>
    </div>
    <div class="c">
        text
    </div>
</div>


div.a
{
    margin-top: 10px;
    clear: left;
    float: left;
    width: 100%;
    text-align: center;
}

div.b
{
    padding: 27px 10px 7px 10px;
    background-color: #fff;
    overflow: hidden;
    float: left;
}

div.c
{
    float: left;
}

What styles should I set for div.c to make it be beside the div.b and fit the remaining width?

It's for a tempalte that will fit 100% of the screen.

thanks!

like image 473
Paulo Avatar asked Dec 29 '25 06:12

Paulo


1 Answers

<div class="a">
	<div class="b">
		<a href="#">click here to be amazed!</a>
	</div>
	<div class="c">
		this is some awesome text
	</div>	
</div>

<STYLE>
	.b,.c {
		padding:15px;
	}

	div.a {		
		border: 1px solid red;
	}

	div.b {
		float: left;
		border: 1px solid blue;
	}

	div.c {
		border: 1px solid green;
	}
</STYLE>
like image 117
Chase Seibert Avatar answered Jan 03 '26 21:01

Chase Seibert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!