Forum Moderators: not2easy

Message Too Old, No Replies

Is there any solution to set flexible CSS width when there is plugin?

         

toplisek

6:30 pm on Oct 16, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have seen that facebook plugin inserts content with the fixed width (example: Like plugin).
.fb-like span

As responsive width demands percentage it will not be recognized by browser if I define min-width: 100%.

Plugin inserts content but width will not be flexible as it is not as text or link inside element.

Example: border-right with 1px is not moved when you insert Like content within this element.

Can be this avoided?

mw11

7:34 am on Oct 19, 2014 (gmt 0)


I'm not sure what your question is.
Could you rephrase your question?

CSS is object oriented.
Let's say you decide you need an object,
and you name it "fb-like-span".

NOTE 1: Don't forget the 'dash' before the 'span'!
NOTE 2: Choose a meaningful name!

If you do everything right,
then you write:

.fb-like-span {
width: 90px;
height: 120px;
border-right: 1px;
}

NOTE 3: Saying "with: 100%" is pretty much meaningless. 100% of what?

If you're unsure about the width or hight?
Then simply remove the width and the height.

In that case your HTML page will load a
tad slower. However, your oage will render
with all flexibility.

Example: Let's say the user's JavaScript is disabled. Then your HTML page will simply
render like as if the object "fb-like-span"
wasn't even there.

lucy24

8:05 am on Oct 19, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



100% of what?

Of the container, whatever that may be. But toplisek, FB isn't attaching a width to a
span
is it? That wouldn't make sense. Only block-level elements (including inline-block) can have a width.

:: hasty detour to make sure I'm not talking through my hat ::