2 replies [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 36 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Well the question explains it all

Js fiddle

if you go through the fiddle , you'll see that , the only css i have specified is

 p{
    width: 4em;
  }

how do i change that to

 p{
    width: Hey P tag please take the width of the text inside you;
  }

Thank you .

Kind regards .

Gautam.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 hours 19 sec ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9759
Points: 3841

p {display: inline;} or p

p {display: inline;} or
p {display: inline-block;} or
p {display: table;} or
p {float: left/right;}

each of these cause an element to shrink-wrap it content.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 36 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Awesome

One word "Awesome" !!