Making a CodePen Embed Resizable is Easy!

Category Image 091

Just a little CSS. If you use the default recommended HTML embed code, the <iframe> that is ultimately the CodePen Embed itself is wrapped in a <div>:

<div class="cp_embed_wrapper">
  <iframe ... ></iframe>
</div>

That outer <div> gives you an opportunity to make embeds resizeable or do whatever other styling you might want. You could also put your own wrapper around it, whatever floats your boat.

The very easiest bit of CSS to apply to your page to make the embed resizble:

.cp_embed_wrapper {
    overflow: hidden;
    resize: horizontal;
}

Wanna resize both ways?

.cp_embed_wrapper {
    overflow: hidden;
    resize: both;
}
.cp_embed_wrapper > iframe {
    height: 100%;
}

Here’s a version that stays centered and has a little bonus styling. As an embed, so meta!

The post Making a CodePen Embed Resizable is Easy! appeared first on CodePen Blog.

Varchar vs Nvarchar Sql Server Difference (2022)

Featured Imgs 23
Varchar and Nvarchar are data types in SQL Server. The main difference between varchar and narchar is that the narchar is used for storing Unicode characters while varchar is used for storing Non-Unicode characters. Data storage is 1 byte per character in varchar while data storage in nvarchar is 2 bytes per character. In field […]