I'm trying to put 2 elements side by side, where the second element has a fixed width of 100pixels, and the first one is to take up all the space beside it. (So if the width is 900 pixels, it would be 800 pixels).
I tried doing it with percents but obviously different screen resolutions will mess it up completely. (Basically, if you've done Android programming, what I'm trying to do is have one object that's 100pixels, and the other to be of match_parent width to fill out the rest of the LinearLayout). Is this possible in pure CSS? I'm using Bootstrap 3 if that helps.
You don't have to use absolute pos. Any method will work it just depends on how detailed you want to get. If you want container1 to have a background equal to container2 simply wrap both of them in a main container div and float all of them to the left with a fixed pixel height. If you want to keep sidebar text from flowing underneath main content put pixel or percent values on both div heights. If you use HTML5 you can use flex boxes or section tags to avoid using divs. Here are some helpful links for you: check out matthew james taylor's design blog1: http://matthewjamestaylor.com
You might also consider checking out a book: CSS the missing manual. There's gobs of good stuff in there-a great resource.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments