- This topic is empty.
-
AuthorPosts
-
April 2, 2017 at 10:16 am #253365s_cristinaParticipant
Hi there :)
I have a little problem with the floating..
Doesn’t work how I expected..
I would like that the text first floats right, so it has the same line like the Menuline above. But if the window goes smaller it should change to float left.Here is a little demo of my problem in codepen.
Just ignore my Logo position…Thanks!
April 2, 2017 at 11:28 am #253369BeverleyhParticipantLittle demo?
Hmmmm, the idea is to provide a reduced demo in CodePen – just enough HTML and CSS to demonstrate the float problem, rather than dumping 8 thousand (and more) lines of CSS…
April 2, 2017 at 11:45 am #253370s_cristinaParticipantI tried to reduce more..
better?April 2, 2017 at 12:39 pm #253372BeverleyhParticipantI think the main problem is that you’re setting container widths to fixed proportions using px values, so when there isn’t room for them to sit alongside each other, they break on to different lines. Try working with % instead so that they fluidly contract and expand along the same line. You probably also want to introduce something to make img elements responsive (max-width:100%?)
April 2, 2017 at 2:05 pm #253374s_cristinaParticipanthmm.. somehow still doesn’t work :(
April 2, 2017 at 3:05 pm #253375BeverleyhParticipantWhat doesnt work?
Tip: make the img elements responsive.
Tip: use a media query to reverse the floats at the desired breakpoint.
April 3, 2017 at 12:41 pm #253391s_cristinaParticipantThanks for answering.
Well let’s say like this.. I am a beginner in coding and these to tips that you gave me, I don’t know how to do it. That’s why I am stuck.
I tried to put the max-width and all the width in % put it didn’t change to much. The only change is, that it doesn’t float anymore.
April 3, 2017 at 1:11 pm #253392BeverleyhParticipantYou might want to re-read what I said about max-width ;)
This….
make img elements responsive (max-width:100%?)
The tip applies to the img element.
April 4, 2017 at 12:31 pm #253410s_cristinaParticipantAhaa know I see.. but what about my text issue?
It should go below the first img..Thanks for your help!
April 4, 2017 at 12:32 pm #253411s_cristinaParticipantAhaa know I see.. but what about my text issue?
It should go below the first img..Thanks for your help!
April 4, 2017 at 2:35 pm #253413BeverleyhParticipantI thought this was an exercise in floating left and floating right?
If you want the text to sit below the img, just remove/null the floats.
April 5, 2017 at 7:02 am #253441AtelierbramParticipantWith this design-pattern image-text using floats, best method is to use the so-called media-object, OOCSS by Nicole Sullivan IMO (one can use flexbox too but that is something for another demo). Read more about this searching for something like: “the media object saves hundreds of lines of code” site: stubbornella.org.
The second example in my fork of the demo uses this method. Note the HTML-markup differs a bit from the first example, and note the CSS-code is put within a media-query:
@media (min-width: 960px) { .demonstrations-media, .demonstrations-media_content { overflow: hidden; } .demonstrations-media_image { float: left; margin-right: 2em; } }
April 5, 2017 at 11:46 am #253444s_cristinaParticipant@Beverleyh
Thanks for your fast answers and helping ! :)
@Atelierbram
That’s exactly what I’ve been looking for!
I thank you so much for helping me!
(I guess I told this a billion times but seriously.. Thanks)April 5, 2017 at 12:23 pm #253446AtelierbramParticipantYou’re welcome; take it easy (one step at a time ;)
April 5, 2017 at 2:02 pm #253451s_cristinaParticipantHow can I change the Title to Solved?
-
AuthorPosts
- The forum ‘Design’ is closed to new topics and replies.