Apply 'float' to parent <div> tag

Posted on 2016-07-31
Last Modified: 2016-07-31

<div class="basicdiv3rows">
  <div class="row1">art</div>
  <div class="row2-horizontallinemain-artandculture"></div>
  <div class="row3">life</div>

Open in new window

Please let me know that apply 'float' to parent cause apply to children also?
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Accepted Solution

bigeven2002 earned 500 total points
ID: 41736754

Yes, the parent element is inherited by the child element so the nested DIVs will also float right.  In the CSS, a clear float DIV should follow the closing tag of the parent DIV.

.basicdiv3rows {
.clearfloat {

Open in new window

<div class="basicdiv3rows">
  <div class="row1">art</div>
  <div class="row2-horizontallinemain-artandculture">culture</div>
  <div class="row3">life</div>
<!-- remove or comment out line below if you do not want a line break after the floated divs -->
<div class="clearfloat"></div>
Next line

Open in new window

Here is an example from the code above:

Author Comment

ID: 41736983

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Obsolete font tag need to convert to CSS 3 55
CSS DIV Height in Percent 1 39
CSS (jquiry mobile) question 3 34
ninja forms fields lay next to each other 1 23
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question