BIGB185 Posted May 17, 2019 Share Posted May 17, 2019 I'm attempting to add code to a class project that will display images on a page side by side. I found the code here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_images_side_by_side The problems I'm having are that my instructor wants me to move the code from the "style" area of the code to a separate CSS file and link to that file in the code but when I move the code it doesn't work. Also, I'd like to be able to make embedded videos on the site line up side by side as well but the code doesn't work for that at all. All the other code in the CSS file is fine except for that bit of code. Any help would be appreciated. Thanks ahead of time. Link to comment Share on other sites More sharing options...
Funce Posted May 17, 2019 Share Posted May 17, 2019 Take a look at this page to see what's required for external stylesheets vs internal stylesheets. https://www.w3schools.com/css/css_howto.asp If it's not working, could you paste some of your CSS here? Link to comment Share on other sites More sharing options...
BIGB185 Posted May 18, 2019 Author Share Posted May 18, 2019 Thanks, Funce for the reply. The code I'm using is: <style> * { box-sizing: border-box; } .column { float: left; width: 33.33%; padding: 5px; } /* Clearfix (clear floats) */ .row::after { content: ""; clear: both; display: table; } </style> Link to comment Share on other sites More sharing options...
Funce Posted May 19, 2019 Share Posted May 19, 2019 Try using a code block, so you can get colours and so your code doesn't get eaten by the formatting machine. So for this, all you would need to do is move that CSS code to an external stylesheet. your_stylesheet.css * { box-sizing: border-box; } .column { float: left; width: 33.33%; padding: 5px; } /* Clearfix (clear floats) */ .row::after { content: ""; clear: both; display: table; } and then link to that stylesheet with the <link> tag. <link rel="stylesheet" type="text/css" href="your_stylesheet.css"> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now