CSS - iframe width and height problem

Hello, I have this site: https://gaab.42web.io/crochet/crochet.php Ideally, I would like to use CSS to set the width and height of the iframe. But I can't. When I delete the width and height attributes from the iframe tag and use CSS to set them, nothing happens. Can someone help me, please?
8 Replies
Chris Bolson
Chris Bolsonβ€’3mo ago
You should be able to set the width and height via CSS. What actualy code are you using?
lanszelot
lanszelotOPβ€’3mo ago
Nothing. Because everything I tried is wrong. Nothing is working.
vince
vinceβ€’3mo ago
These?
No description
vince
vinceβ€’3mo ago
Just adding the width and height to the iframe worked like Chris pointed out. You should also still keep a width & height attribute to the iframe even if you're styling with CSS anyway to help the browser out
lanszelot
lanszelotOPβ€’3mo ago
But it is not working. This is what I wrote: "When I delete the width and height attributes from the iframe tag and use CSS to set them, nothing happens." This is why I left them in the iframe attribute. But in this way I cannot do responsive.
Chris Bolson
Chris Bolsonβ€’3mo ago
iframe dimensions can be defined via CSS. If you want somebody to help you see why it is isn't working in your case, you really need to share the code that you were trying.
vince
vinceβ€’3mo ago
Right, but in the screenshot you can see it is working πŸ‘€
lanszelot
lanszelotOPβ€’3mo ago
Thank you so much for everybody. Sorry but I could continue few days later. Hello, I found what was the problem. When I change something in css or js I add new number to the file name. Example: file03.css I forgot I already used 08 and I edited 07. The php used 08 not 07 , this is why did not changed anything. Oops ☺️ Thank you so much for helping to everyone

Did you find this page helpful?