Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
9.4k views
in Technique[技术] by (71.8m points)

javascript - <p> elements surrounding <iframe> to overlap it whilst still being able to click on the <iframe> and the <a>'s in the <p>'s


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should try this...

#roll{
    width:500px;
    margin-right:auto;
    margin-left:auto;
}

p{
    position:relative;
    font-size:1.5em;
    z-index: 1;
}

.codepoem{
    width:500px;
    height:200px;
}

.codepoem iframe{
    position:relative;
    width:calc(500px + 20vw); 
    margin-left:-10vw; /* center horizontal */
    height:calc(200px + 40vh);
    margin-top:-20vh; /* center vertical */
    /*z-index:1;*/
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...