last day (15 days later) » 

3:35 PM
0
Q: CSS alignment on my webpage between two elements

Alex WileyI have two elements on my page which I wish to align side by side, what would be the best way of going about this, and can somebody explain the best way to go about coding it when you want to align elements together. In this example I want the video to take up most of the room say 3/4 and the ch...

 
did it fix your problem?
 
Yes it did, I have understood this a lot better now thank you! One more question, you know the video element, if I wanted to have text aligned on the left, how would I do it? I have tried text align, but when setting it to left it makes the text disapear somewhere? Links below for code and pictures: bit.ly/1mteDn6 .video { width:750px; height:420px; background-color:yellow; margin-bottom:10px; } .video-element { background-color:blue; width:460px; margin-top:20px; } .video p { text-align:center; }
HTML <div class="LeftContent"> <div class="video"> <div class="container"> <div class="video-element"> <iframe width="460" height="215" src="//www.youtube.com/embed/PdABTJhRTLY" frameborder="0" allowfullscreen></iframe> </div> <p>Watch dog has recently come onto the market</p> </div> </div> </div> </div>
 
Try to make use of JSFiddle, like I did. - By default text is aligned to the left. The next problem is that the video is in a frame, so the text is behind the video. Make sure to have another DIV below the video and put the text in there, this will probably fix your problem.
 
I have tried this but still no luck, I have outlined the text in red and it is behaving weird. IF I set the width of the text to 100% I would expect it to fill the yellow box as it is inside that div? But it does not, it spans the width of both elements if set to 100%. fiddle.jshell.net/aj5xt
 
you want "Watch dog has recently come onto the market" to be aligned to the left? Just remove text-align:right; in the .VideoText. Then I've tried in your fiddle link, when you put the width to 100% it fills from left to right like it should. It doesn't fill below your line because you don't have a height property, put in a height property or add new lines: fiddle.jshell.net/aj5xt/1
 
3:35 PM
Like this: bit.ly/WvcRgr I haven't got enough rep, could you possibly start a chat? Easier that way?
 
fiddle.jshell.net/aj5xt/2 Maybe add some margin to the frame.
Can you see this already?
 
3:50 PM
Just want to say thank you very much for all the help
I believe I have found a fix, your does work, but before that I noticed that in the HTML for the iframe if you set align="left then it aligns the video to the left allowing the text to take place on the right hand side
 
4:03 PM
yea
thats the idea right?
if you like, please upvote my comment from the last fiddle :)
 
Will do, horrible to align those elements but get there in the end.
I'll upvote it now
 
4:20 PM
hehe, yes.
 

last day (15 days later) »