How to move divs to bottom and top of absolute div

Yu Mad

I have a Codepen link where I have an absolutely positioned div, which has two children.

I'm trying to move one child to the top of the div, while the other to the bottom, but cant quite figure it out with bottom:0 and top:0. I'm also trying to only use the width of the content for one of the elements, as opposed to the entire width of the parent element.

Jay

Change the CSS :

.event-type-label{
  background: rgba(161,178,166,.8);
  border-radius: 2px;
  overflow: hidden;
  font-family: Lato;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  position: absolute;
  top: 0;
  font-size: 0.8em;
  font-weight: 300;
  letter-spacing: .05em;
  line-height: 1;
  padding: 5px;
}

.event-header-title {
color: #fff;
position: absolute;
bottom:0;
font-family: Lato;
font-size: 3em;
font-weight: 300;
line-height: 120%;
margin: .5rem 0;
}

Adding position:absolute to the childs will solve your problem. As absolute positioned elements take the width of content only.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to move "div" bottom to top and top to bottom when click on same "div"

From Dev

How can I move a div from top to bottom by using jQuery?

From Dev

How can I move a div from top to bottom by using jQuery?

From Dev

Fix two divs to the bottom and top of another div

From Dev

Move divs down when top div expands

From Dev

Position DIVs in top right of image and in top bottom another div

From Dev

how to slide the divs in section from bottom to top

From Dev

How to make two divs top and bottom

From Dev

How to top align two cell divs within a table div when one cell div contains an absolute positioned div?

From Dev

How to have 3 divs aligned up next to each other so that they are in between a bottom and top div?

From Dev

Margin-top for absolute positioned div with bottom property

From Dev

How to delete top divs without causing bottom divs to jump up?

From Dev

Move DIV to Right form Bottom with relative to Top DIV

From Dev

align two divs, one at top one at bottom of a third div

From Dev

Divs on top of each other, bottom div edge showing.

From Dev

Placing 2 divs (top bottom) behind container div

From Dev

How to move div to top and remove?

From Dev

How to float 2 divs at the bottom of a div

From Dev

How do I set these divs to bottom & top of container?

From Dev

How to make top and bottom of div triangle with CSS?

From Dev

How to make top and bottom of div transparent

From Dev

3 Divs on Top Middle and Bottom

From Dev

Position divs from the bottom to the top

From Dev

Overflow hidden not working for "vertical aligned bottom" - divs in an absolute positioned outer div

From Dev

How can I align 2 or more "row" divs to the bottom of a div, without using any kind of "absolute" positioning? Needs IE9+ support

From Dev

How to center a div sandwiched between two absolute divs?

From Dev

How to move item to top and bottom of selectlist using jquery

From Dev

How to move "Show Applications" button from bottom to top in launcher?

From Dev

An Inline Relative Div with Absolute Divs In It

Related Related

  1. 1

    how to move "div" bottom to top and top to bottom when click on same "div"

  2. 2

    How can I move a div from top to bottom by using jQuery?

  3. 3

    How can I move a div from top to bottom by using jQuery?

  4. 4

    Fix two divs to the bottom and top of another div

  5. 5

    Move divs down when top div expands

  6. 6

    Position DIVs in top right of image and in top bottom another div

  7. 7

    how to slide the divs in section from bottom to top

  8. 8

    How to make two divs top and bottom

  9. 9

    How to top align two cell divs within a table div when one cell div contains an absolute positioned div?

  10. 10

    How to have 3 divs aligned up next to each other so that they are in between a bottom and top div?

  11. 11

    Margin-top for absolute positioned div with bottom property

  12. 12

    How to delete top divs without causing bottom divs to jump up?

  13. 13

    Move DIV to Right form Bottom with relative to Top DIV

  14. 14

    align two divs, one at top one at bottom of a third div

  15. 15

    Divs on top of each other, bottom div edge showing.

  16. 16

    Placing 2 divs (top bottom) behind container div

  17. 17

    How to move div to top and remove?

  18. 18

    How to float 2 divs at the bottom of a div

  19. 19

    How do I set these divs to bottom & top of container?

  20. 20

    How to make top and bottom of div triangle with CSS?

  21. 21

    How to make top and bottom of div transparent

  22. 22

    3 Divs on Top Middle and Bottom

  23. 23

    Position divs from the bottom to the top

  24. 24

    Overflow hidden not working for "vertical aligned bottom" - divs in an absolute positioned outer div

  25. 25

    How can I align 2 or more "row" divs to the bottom of a div, without using any kind of "absolute" positioning? Needs IE9+ support

  26. 26

    How to center a div sandwiched between two absolute divs?

  27. 27

    How to move item to top and bottom of selectlist using jquery

  28. 28

    How to move "Show Applications" button from bottom to top in launcher?

  29. 29

    An Inline Relative Div with Absolute Divs In It

HotTag

Archive