Hey ninjas, in this CSS Positioning tutorial, I'll introduce you to floating elements. CSS floats are one of the most powerful and widely used CSS positioning properties, but can be a little tricky to get your head around at first!
SUBSCRIBE TO CHANNEL - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1
========== CSS for Beginners Playlist ==========
========== HTML for Beginners Playlist ==========
========== The Net Ninja ============
For more front-end development tutorials & to black-belt your coding skills, head over to - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk
========== Social Links ==========
Twitter - @TheNetNinja - https://twitter.com/thenetninjauk
You, sir, have the metabolism of a sparrow. If you could just talk more slowly, and enunciate more clearly, then the people of Canada, Australia, New Zealand, India, all of the United States, and indeed most of remaining Britain, could understand what you're trying to convey.
Heyy Ninja, its been 4 years now since you released this video and a lot of things have changed I think. Just having a query, when u float all the box to left, they are still inside the white area, but in my case, white area's height becomes 20px due to padding of 10px each side, and box height is 100px, this makes these box out of the white area, why is it happening??
That would be correct.
If an element has 'position: absolute' then the positioning values of 'top', 'left' etc position it relative to the nearest ancestor which has a position property set. If there's no such ancestor, then the element is being positioned relative to the html element (or window).
Great Explanation, thanks!!!
In case of box when u add a float : left style to red box its overlapping green box which is in document flow, But in image case why image not overlapping paragraph textwhen we apply float : right to it?
Ok, I know this is for the seasoned devs but it's important to note that float nowadays is the back compat response to supporting IE - people REALLY should be using/taught display: inline-block as it clears itself (is extremely widespread in terms of support) and adheres to the workflow! Float was never designed for layouts but was the solution when we all took the leap into tableless design looking for solid support.
For start sorry for my bad english. I didn't uderstand while in the first example you have shown us about an image floating next to a text, the text wasn't hidden behind the image, whereas; in the second example, the green box was hidden behind red box. I think the green box should stay next to the red box, but it was hidden behind. Im so confused.Maybe it is a rerlationship between <p> tags and <img> tags. Please enlighten me! :)
bro that's how floats work!! the elements moves to the left and gets floated ie. gets above through some height and due to the free space available ,the elements below it moves upwards in order to fill that vacant space,.....................https://youtu.be/xara4Z1b18I visit this to understand it in detail.
Yes mate, amazing. I've been teaching myself for 2 months, watching videos, reading books, and even watched a bunch of Treehouse. No one has done this yet. Also, the only thing I've struggles with is css positioning. No one can explain it well. I think your videos may do the trick. Thanks!
Hey, class="red box" means the element has 2 classes - one of them is 'red' and the other is 'box'. It does not mean 1 single class of 'red box'. It would only be a single class if there are no spaces between the words. For example, class="red-box" or class="redbox". Hope this helps :)
Oh yeah I forgot that offsetting, Thanks man! I already watched that playlist. but did not strike until now.
btw, I tried Brackets. Live integration doesn't work sometimes, So I'm using Dreamweaver. and it Rocks.
FYI, THIS Playlist is Not listed in your Channel Playlists Page along with other CSS PlayList. Add It. I particularly searched for this and then came here.
Subscribed. I just started learning HTML & CSS. You will be great companion from now on.
Hey, you could use position absolute, to absolutely position an element over another - this is how Google does it. For example:
<input type="text" />
<div id="your-button">button img or text</div>
You could give the container a position of relative. Span the input field 100% in width & position the 'your-button' div absolutely over the right side of the input field. I cover both relative and absolute position later in this playlist!
Hey Felipe, There are little tricks using position:relative and the transformY property to achieve the text directly in the centre..
However, I would recommend using flexbox to centre the content, its much easier and tends to be the way to do it these days..
Apply "display: flex" to the parent div
and "margin: auto" to the element itself should result in a perfectly centred element.
p.s im also just learning so there might be other ways to achieve without using flexbox..
the class names used are "blue box", "red box" and "green box" , when he used .box then the properties mentioned got applied to all three div's and when he used .blue, .red and .green then the properties got applied to the div whose class name consisted of red green or blue. This is a way of selecting classes.
Hello from russia. I understand what you say, but i only see and after i understand what you do. :D haha thanks man:) you must know, what in Russia not have good tutorial... really. you very good, befory this video you packing material ( code ) i see this you work. it really good.
Hi! Thanks for this wideo :) I have a question: WHY in 05:07 the blue box is at the same level as red box?
Why the blue box after adding "float: right;" didnt come higher than red box?
In "div" blue box its higher that "div" with red box ... Im confused. :(
Its not a normal website flow as on the example with image in 02:43?
how do you float one box in the dead middle? even if it is the only box. Also the div container, does it automatically adjust it's size if the person resize the webpage it was on or do the letters in the box or box go all crazy?
you are the best tutor ive come accross on youtube. i have request can you make a tutorial about learning code? what i mean is whenever i learn new code i forgot it after 5 minutes or so. can u make a tutorial about learning and not forget
Learning how to draw cartoon animals from the farm is not such a difficult task! Weve grown up surrounded by them! Farm animals are everywhere: In blockbuster movies, childs books, greeting cards. their shapes and images are printed in our minds!
In this section, I will show you how to determine what are the physical uniqueness of each animal and how to work with them. Then, you can practice drawing each cartoon character using basic shapes.
You will have the opportunity to make nice illustrations, practice sketching and cartooning using short easy lessons and complete your creation using a drawing software to create vector art if you want to! Cartoon drawing is really fun once you get into it!
Dont be afraid to try until you get it right. This method is really simple, but requires practice and observation. So, sit back and relax. Learn how to draw animals from the farm and start your journey on a good note!
Lets try s few basic characters to get started! :)
A cute turkey to begin with.
In this first tutorial, you can learn how to draw a fun turkey mostly made from small rectangles and large circular shapes. The posture of the character is really interesting. Not only is it easier to draw than a front version, but its also easier to add some perspective (as we can see with the legs). The fact that we just need to draw one wing is also interesting.
Most of these cartoon animals are not filled with complex textures or digital effects. In this case, the subject is filled with plain colors and only a few basic details (inside the tail) were added.
A nice turtle also from a side view.