- This topic is empty.
July 7, 2014 at 5:17 am #174886
I have been trying to create a flexible banner strip like this,
<——————- fixed width ————->
<- – – – – – – – main container – – – – – – – ->
———— Variable text content ————
<–border–> T E X T <–border–>
define background for main container & center the text content
But I would like to do the same thing without using background,
< text content>
whereby the width of the contents are flexible so that the text content (always center-aligned) pushes out the border styles.
Ofcourse the width of text content < width of main container.
But this one is not flexible and the width of the contents are fixed.
Is this possible using pure css?July 7, 2014 at 5:33 am #174887July 7, 2014 at 6:19 am #174889
This is great.
But isn’t it possible to do it the other way.
Variable Text Content
*whereby the width of the contents are flexible so that the text content (always center-aligned) pushes out the border styles.July 7, 2014 at 6:43 am #174891
You’d have to show me what that would look like.
Don’t worry about how you achieve it..I ‘m just having trouble working out what it is you are trying to do.July 7, 2014 at 7:02 am #174892July 7, 2014 at 7:23 am #174895July 7, 2014 at 8:16 am #174897
So you’ve done it…
Is this solved?July 7, 2014 at 10:11 am #174904
No it’s not done.
Is it possible to accomplish the same using only CSS?July 7, 2014 at 10:13 am #174905July 7, 2014 at 10:26 am #174907
Thanks. But is it not possible to make the same without using Pseudo-classes? I hope I am not being too demanding.:/
I was wondering if it is possible using calc?
https://developer.mozilla.org/en-US/docs/Web/CSS/calcJuly 7, 2014 at 10:36 am #174908
But is it not possible to make the same without using Pseudo-classes? I hope I am not being too demanding.:/
Frankly, yes…I think your expectations are a little unrealistic.July 7, 2014 at 10:37 am #174909MDMuellerParticipant
Sure, you could use a normal div aswell, but then you’ve got 1 more (unnecessary) tag. Or you could use border-box and a background-image.
Why don’t u wanna use pseudo classes?July 7, 2014 at 10:46 am #174910
Ok guys. I am being impractical here & sorry for wasting your time. Clean and viable CSS it is then. Lets wrap it up and consider it answered.
Thank you for your help and time.July 7, 2014 at 10:43 pm #174944
Thanks for your answer but I am looking to solve this without using Pseudo classes.
- The forum ‘CSS’ is closed to new topics and replies.