MARCELO Posted April 5, 2018 Share Posted April 5, 2018 I was building something and between two pairs of text+picture, i decided to make a division using this keyboard key: _ . So i had something like this: __________________________________________________________________________________________________________________________ But in the smartphone, i had this: _____________________________ _____________________________ ______________________________ which is not something i wanted to, Is there a way i can present one single line anywhere (laptop, smartphone, etc)? Thanks. Link to comment Share on other sites More sharing options...
dsonesuk Posted April 5, 2018 Share Posted April 5, 2018 A responsive line? tried a hr element https://www.w3schools.com/code/tryit.asp?filename=FQ3IJ9HRC2XE 1 Link to comment Share on other sites More sharing options...
MARCELO Posted April 5, 2018 Author Share Posted April 5, 2018 thanks Link to comment Share on other sites More sharing options...
MARCELO Posted April 8, 2018 Author Share Posted April 8, 2018 Reading about the hr element, i couldn t find out how to specify a color i want for it. It s says it ¨should render in one solid color (noshaded)¨ But does it mean it can only have one color, even if i try to style it some special way? Thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted April 9, 2018 Share Posted April 9, 2018 Use CSS to set the border to zero, give it a height of one or two pixels and then give it a background color. CSS lets you style any element in any way, even the <hr> element. The specification only indicates how the browser should style the <hr> element by default when no CSS is applied. Link to comment Share on other sites More sharing options...
MARCELO Posted April 9, 2018 Author Share Posted April 9, 2018 Well Ingolme, this is not working: https://www.w3schools.com/code/tryit.asp?filename=FQ7W4YUKVORW And i want it to be right in the middle, so i use the margin-left property. A tip about what s wrong is enough for me. Thanks! Link to comment Share on other sites More sharing options...
dsonesuk Posted April 9, 2018 Share Posted April 9, 2018 Its 'background-color:' notice the hyphen and to centre, it needs to be a display: block; element with margin: 1em auto; Link to comment Share on other sites More sharing options...
MARCELO Posted April 10, 2018 Author Share Posted April 10, 2018 Right! Just one thing: what s 1em ? thanks Link to comment Share on other sites More sharing options...
dsonesuk Posted April 10, 2018 Share Posted April 10, 2018 https://www.w3schools.com/cssref/css_units.asp 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