我有一个奇怪的问题.我的div宽度之一不起作用.我的CSS就像
.product_info
{
margin-top:10px;
background:#444;
width:850px;
}
.product_image
{
width:350px;
text-align:center;
float:left;
padding:8px;
border:1px solid #e9e9e9;
background:#fff;
}
.product_details
{
float:left;
width:400px;
margin-left:25px;
font-size:14px;
font-family:"Helvetica";
background:#d71414;
}
Run Code Online (Sandbox Code Playgroud)
我的HTML文件是
<div class="product_info">
<div class="product_image">
</div>
<div class="product_details">
<div class="selection">
<form action="{$path_site}{$indeex_file}" method="post">
Size
{foreach name = feach item = k from = $product_size}
<input type="radio" name="size" value="{$k.product_size}" />{$k.product_size}
{/foreach}
</div>
<div class="selection">
No. of pieces <input type="text" name="quantity">
</div>
<div class="prc">
<span class="WebRupee">Rs.</span> {$product_info->product_cost}.00
</div>
<div class="buy_btn"><input type="submit" value="BUY" /></div>
</form>
</div> …Run Code Online (Sandbox Code Playgroud) 我有一个类似于下面的表结构:
<tr>
<td colspan="5">
TEST
</td>
</tr>
<tr id="abcd_<?php echo $id; ?>" style="display: none">
<td colspan="5">
<span id="hidtb_<?php echo $id; ?>"></span>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
该表位于循环和$id更改的值内.第二个tr设置为display : block使用javascript.但是 <td colspan="5">并没有覆盖所有五个<td>,而只是一个.
.为什么我colspan不工作?
我想在我的网站的主容器中创建一个元素容器.为了使元素容器成一行,我申请float:left;了它们.但当我加入float它们时,主容器缩小了!我尝试应用于clear:both主容器,但没有任何变化.
CSS:
#main_container
{
clear:both;
margin-top:20px;
padding:20px 10px 30px 15px;
background:#ccc;
}
.element_container
{
float:left;
width:238px;
height:300px;
border:1px solid #000;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="main_container">
<div class="element_container"></div>
<div class="element_container"></div>
<div class="element_container"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

我是新的,实际上这是我对android程序的第一次尝试.我正在关注android开发者培训网站.我activity_main.xml看起来如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<EditText android:id="@+id/edit_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_hint="@string/edit_message"/>
Run Code Online (Sandbox Code Playgroud)
现在它显示错误和警告,如:
警告 - This text field does not specify an inputType or a hint
错误 - error:Error:No resource found that matches the given name( at 'layout_hint' with the value '@string/edit_message')
我有一个名为的库文件 myMenu.php
<?php
class myMenu{
function show_menu()
{
$obj = & get_instance();
$obj->load->helper('url');
$menu = "<ul>";
$menu .= "<li>";
$menu .= anchor('books/index','List of books');
$menu .= "</li>";
$menu .= "<li>";
$menu .= anchor('books/input','Books entry');
$menu .= "</li>";
$menu .= "</ul>";
return $menu;
}
}
Run Code Online (Sandbox Code Playgroud)
现在我在控制器中加载了这个库 books.php
function index()
{
$this->load->library('myMenu');
$menu = new myMenu;
$data['menu'] = $menu->show_menu();
$this->load->view('main_view',$data);
}
Run Code Online (Sandbox Code Playgroud)
但页面显示错误An error occurred : Unable to load the requested class: mymenu.为什么这个错误显示类名 mymenu(全部为小写),其中我myMenu在控制器中写道
我是cakephp的新手.我需要添加一个默认值
<option value="0">--Please Select--</option>
Run Code Online (Sandbox Code Playgroud)
在我的以下选择字段中:
$attributes = array("empty"=>false,"Selected" => 'Select City',"id" => "location");
echo $form->select("gal_location_id", $gal_locations,null,$attributes);
Run Code Online (Sandbox Code Playgroud)
我试着补充一下
$gal_locations[0] = "--Select City--";
$attributes = array("empty"=>false,"default" => 0,"id" => "location");
Run Code Online (Sandbox Code Playgroud)
但选项位于列表的底部.添加默认选项的正确方法是什么?
我是drupal主题的新手.我创建了一个direcory mytheme并添加mytheme.info到它并从drupal的默认主题目录中复制了其他文件.编辑后page.tpl.php,drupal显示下面的错误.
Notice: Undefined variable: hide_site_name in include() (line 99 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined variable: hide_site_name in include() (line 109 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: featured in include() (line 168 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: highlighted in include() (line 187 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: sidebar_second in include() (line 212 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_first in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_middle in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: …Run Code Online (Sandbox Code Playgroud) 我试图在codeigniter中将数据插入mysql.控制器类:
class Ci_insert extends CI_Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
$data = array(
"USN" => "TRE5rCS89G",
"name" => "NITISH DOLAKASHARIA",
"branch" => "CS"
);
$this->load->model('ci_insert_model');
$this->ci_insert_model->addToDb($data);
}
}
Run Code Online (Sandbox Code Playgroud)
型号类:
class ci_insert_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function addToDb($data)
{
//var_dump($data);
$this->db->insert('class_record',$data);
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我试图运行代码时,它会显示出来Fatal error: Call to a member function insert() on a non-object in C:\wamp\www\CodeIgniter\application\models\ci_insert_model.php on line 12.
上面的代码有什么问题?
我想在CodeIgniter中构建一个简单的表单.我的视图'input_view.php'是:
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo "$base/$css"?>">
</head>
<body>
<div id="header">
<?php $this->load->view('books_header'); ?>
</div>
<div id="menu">
<?php $this->load->view('books_menu'); ?>
</div>
<?php //echo $title; ?>
<?php echo form_open('books/input'); ?>
<?php echo $title; ?>
<?php echo form_input('title'); ?>;
<?php echo $author; ?>
<?php echo form_input('author'); ?>
<?php echo $publisher; ?>
<?php echo form_input('publisher'); ?>
<?php echo $year; ?>
<?php echo form_dropdown('year',$years); ?>
<?php echo $available; ?>
<?php echo form_checkbox('available','yes',TRUE); ?>
<?php echo $summery; ?>
<?php echo form_textarea('summery'); ?>
<?php …Run Code Online (Sandbox Code Playgroud) 我试图在javascript中大写字符串中的字符,我的代码是:
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var str = "string";
for(m = 0; m < str.length; m++){
if(str[m] == "r"){
str[m+1] = str[m+1].toUpperCase();
}
}
alert(str);
}
</script>
Run Code Online (Sandbox Code Playgroud)
所以我想要做的是,如果角色是r,则大写下一个角色.但是不是woking意味着它是相同的字符串警报.