Andreas De Rudder Posted March 4, 2016 Share Posted March 4, 2016 Hello, I have on the index page of my website two lines of text with a white background. At this moment the white bar is the full width of the screen, but I would like it to be only the width of the text . How do I have to do that? My website is: www.msngent.be thank you Andreas 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted March 4, 2016 Share Posted March 4, 2016 Remove background color white from text2 class element, place text and link within a new inner div element and use display: inline-block; and give this the background-color: #fff; (white). Link to comment Share on other sites More sharing options...
Andreas De Rudder Posted March 4, 2016 Author Share Posted March 4, 2016 I thank you very much for your answer, but I don't understand how I have to do this. Could you please give a full exemple? I would be very grateful. Thank you! Link to comment Share on other sites More sharing options...
dsonesuk Posted March 4, 2016 Share Posted March 4, 2016 1) .text2 { /* background-color: white;*/ text-align: center; } 2) <div class="text2"> <div> To enter the website click <a href="msn.html">here</a> </div> </div> 3) .text2 > div { background-color: white; display: inline-block; } Exactly how i said. Link to comment Share on other sites More sharing options...
Andreas De Rudder Posted March 4, 2016 Author Share Posted March 4, 2016 Thank you very much! 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