Support Forum

Iframes question

KV kvr28
kvr28
Member

this may be a little dense, but, here is the issue I am running into, my wordpress theme handles video embeds and such at 100 percent width for responsiveness, which carries over to the forum, so embedded videos are huge, I know you can add something like this work around that

.spPostContent iframe {
max-width: 640px !important;
max-height: 360px !important;
}

but, that controls all Iframes, such as a imgur gallery, which would be preferable for 100% width, is there anyway to distinguish between the two?

9 Answers

New Answer

IK Ike
Ike
Member

Can you link me to an imgur gallery in a post to take a look?

KV kvr28
kvr28
Member

sure, he is a video embed as well

http://thehomesteadingboards.com/forums/the-compost-bin-1/take-me-to-church/

here is a imgur

http://thehomesteadingboards.com/forums/construction-and-diy-projects-1/a-penny-table-top/

IK Ike
Ike
Member

Well it doesn’t look to me like there is any way to differentiate between the two, just being inside the iframe, unless anyone else has any suggestions..

KV kvr28
kvr28
Member

okay thanks for looking, one way would be to just use the iframes embed code for the videos instead of just posting the link and auto embedding it, but that would only work for me and not the members since they are not allowed to use iframes

MP Mr Papa
Mr Papa
Member

you should be able to target the iframe specifically if it contains and imgur url…  something like:

iframe[src*=”imgur”] {…}

of course, replace the …  with the css you want…

MP Mr Papa
Mr Papa
Member

not sure exactly what you mean by custom css… but yes, you can add it to your sp theme (child?)…

just not sure what you want to do…

KV kvr28
kvr28
Member

my wordpress theme I meant, not the sp, I’ll give it a shot

MP Mr Papa
Mr Papa
Member

I would expect it should work in either…  though you may have to target a bit more specifically for sp… maybe

#spMainContainer iframe[src*=”imgur”] {…}

but without #spMainContainer may work too… just try both :)