- This topic is empty.
-
AuthorPosts
-
July 7, 2014 at 5:17 am #174886jack_QuarryParticipant
Hello,
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–>method1:
define background for main container & center the text content
example:http://jsfiddle.net/G4DNq/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.example:http://jsfiddle.net/Lz4PC/1/
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 #174887Paulie_DMemberYou mean like this:?
July 7, 2014 at 6:19 am #174889jack_QuarryParticipantThis is great.
http://codepen.io/TheEnd/pen/zFCneBut 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 #174891Paulie_DMemberYou’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 #174892Paulie_DMemberOr do you mean this?
July 7, 2014 at 7:23 am #174895jack_QuarryParticipantCheck this out.
http://jsfiddle.net/2u6kV/July 7, 2014 at 8:16 am #174897Paulie_DMemberSo you’ve done it…
Is this solved?
July 7, 2014 at 10:11 am #174904jack_QuarryParticipantNo it’s not done.
Is it possible to accomplish the same using only CSS?July 7, 2014 at 10:13 am #174905MDMuellerParticipantEnlarge it :)
July 7, 2014 at 10:26 am #174907jack_QuarryParticipantThanks. 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 #174908Paulie_DMemberBut 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 #174909MDMuellerParticipantSure, 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 #174910jack_QuarryParticipantOk 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 #174944jack_QuarryParticipantThanks for your answer but I am looking to solve this without using Pseudo classes.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.