gpt4 book ai didi

带有内容 div、wordpress 的 css 全宽背景

转载 作者:太空宇宙 更新时间:2023-11-03 18:43:12 25 4
gpt4 key购买 nike

我正在为我的投资组合网站使用 wordpress 主题,我正在尝试重新创建我现在看到许多网站都在使用的效果。它本质上是具有标准页面宽度内容的全宽背景图像或 css 背景颜色。

这是一个例子:http://themeforest.net/item/vernumresponsive-onepage-parallax-wordpress-theme/full_screen_preview/4843905

当您向下浏览页面一半左右时,您会看到“您准备好购买这个主题了吗”部分。它就像一个包含内容的分页符。我想在 wordpress 中这样做,但我不需要视差效果。我只需要图像背景或背景颜色 css 来打破初始内容容器,但将其中的内容限制在该容器内。

最佳答案

您可以在主题中使用简码。

例子:

在你的主题中:

function fullWidthBreak_func( $atts ){<br/>
extract( shortcode_atts( array(
'content' => 'default content'
), $atts ) );
return "some css to full widht : $content";<br/>
}<br/>
add_shortcode( 'fullWidthBreak', 'fullWidthBreak_func' );


在您的帖子中:

some content before<br/>
[fullWidthBreak content="some content inside"]
some content after<br/>

引用:

http://codex.wordpress.org/Shortcode_API

关于带有内容 div、wordpress 的 css 全宽背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17070751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com