使用php更改css值 [英] Change css value with php

查看:291
本文介绍了使用php更改css值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改css的div显示我的主页上的一些文本从管理员。
我想在我的插件管理页面中输入一个颜色代码,代码在css文件中更新。这是一件很常见的事情,但不能理解它。



所以这里是我的div的css。

  #div {

background:#0000;

}

这里是我的管理部分的PHP代码。 / p>

 <?php 
背景颜色:< input type =textsize =20name = background
value =<?php get_option('backgroundchanges');?>/>

所以基本上我想要在输入中输入的值反映在css文件中。 / p>

感谢您的帮助。



问:



-ROn。

解决方案

您实际上不应使用.css文件,而应使用.php文件.css文件。然后,您可以将新颜色设置为.php css文件中的一个变量。



如何做到这一点


how can I change css of a div displaying some text on my home page from the admin are. I want when I enter a color code in my plugin admin page, the code is updated in the css file. This is a common thing, but can't get a grasp of it.

so here is the css of my div.

#div{

background: #0000;

}

and here is the php code for my admin section.

<?php 
 Background Color: <input type="text" size="20" name="background"
 value="<?php get_option('backgroundchanges');?>"/>

so basically I want the value that I enter in the input to be reflected in the css file.

thanks for any help.

regards, :)

-ROn.

解决方案

You should actually not use a .css file and instead use a .php file acting as a .css file. Then you can just set the new color to a variable in the .php css file.

How to do this

这篇关于使用php更改css值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆