我正在尝试从超棒的字体中添加一个图标,但是由于某些原因,在加载页面时它不会出现。以下是我的html代码,在其中尝试以不同的方式添加很棒的字体。
<html lang="en">
<head>
<title>Media Queries</title>
<meta name="viewport" content="width=device-width, initial=scale1.0">
<link rel="stylesheet" href="main.css">
<link href='https://fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="font-awesome-4.6.3/css/font-awesome.min.css">
</head>
<body>
<i class="fa fa-car" aria-hidden="true"></i>
<h1>
<i class="fa fa-car" aria-hidden="true"></i>Dummy Text
</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
代码中是否缺少任何内容?
我创建了一个部分来显示所有帖子内容。我现在的工作是将帖子缩略图设置为背景图像。
这里是本节的结构:
<section id="testimonials">
<div class="testimonials-container">
<div class="heading-container">
<h3 class="page-title">Testimonials</h3>
</div>
<div class="testimonials-box">
<?php
$queryposts = array(
'post__in' => array(75,73),
'post_type' => 'post',
'posts_per_page' => -1,
'order' => 'ASC'
);
$lastblog = new WP_Query( $queryposts );
if($lastblog->have_posts() ):
while($lastblog->have_posts()): $lastblog->the_post(); ?>
<div class="testimonial-wrapper">
<div class="testimonial-item">
<p class="test-content"><?php the_content(); ?></p>
<p class="test-title"><?php the_title(); ?></p>
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<div class"image-class" style="background-image: url('<?php echo $thumb['0'];?>')"></div>
</div>
</div>
<?php endwhile;
endif;
wp_reset_postdata();
?>
</div>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
这是我的CSS:
section#testimonials {
height: …Run Code Online (Sandbox Code Playgroud) 我刚刚将我的博客应用程序上传到测试服务器,您可以在此处看到.当我从主页点击帖子时,我可以使用slug url查看单页.但是,从单个页面,如果我刷新页面,它给我一个404页面.
我曾为我的用户组件使用类似下面的内容:
Route::get('/admin/users{vue_capture?}', function () {
return view('admin');
})->where('vue_capture','[\/\w\.-]*');
Run Code Online (Sandbox Code Playgroud)
这就是我的routes.js的样子:
import VueRouter from 'vue-router';
import Admin from './components/Admin.vue';
import Homepage from './components/Homepage.vue';
import Subscriber from './components/subscriber/Main.vue';
import Single from './components/Single.vue';
import Categories from './components/Categories.vue';
let routes = [
{
path: '/',
component: Homepage
},
{
path: '/subscriber',
component: Subscriber
},
{
path: '/post/:slug',
name: 'post',
component: Single
},
{
path: '/categories/:slug',
component: Categories
}
];
export default new VueRouter({
mode: 'history',
routes
});
Run Code Online (Sandbox Code Playgroud)
我的laravel路线是这样的:
<?php
use App\User; …Run Code Online (Sandbox Code Playgroud) 我在一个名为Fonts的文件夹中有一个包含2个自定义字体的文件夹,其中一个名为PlayfairDisplay-Black.我不知道如何在我正在开发的网站中使用它们?
怎么用这些字体?
我试图加载我的jquery脚本但是当我加载页面时,警报消息不会出现.文件main.js保存在我拥有index.html页面的同一个文件夹中,所以我用它来调用页面,但没有发生任何事情,我没有看到任何错误.
<script type="text/javascript" src="main.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是我的html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
</head>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. In veniam doloremque voluptate debitis quaerat ipsum, officia, ad exercitationem placeat quasi nobis enim itaque. Adipisci ullam magnam sequi eum maiores, quia!</p>
<script type="text/javascript" src="main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
( function( $ ) {
$(document).ready(function (){
alert('This shit is not working'); …Run Code Online (Sandbox Code Playgroud) 这是我的方法的样子:
public function show(Game $game)
{
$discussion = DB::table('chatter_post')->whereId($game->chatter_post_id)->first();
$chatter_post = DB::table('chatter_post')->where('chatter_discussion_id', $discussion->chatter_discussion_id)
->whereNotIn('id', [$game->chatter_post_id])->get();
dd($chatter_post);
return view('games.games', ['game' => $game, 'discussions' => $chatter_post]);
}
Run Code Online (Sandbox Code Playgroud)
当我在 dd($chatter_post) 中转储和死亡时,我可以看到所有数据:
0 => {#861 ?
+"id": 20
+"chatter_discussion_id": 25
+"user_id": 1
+"body": "<p>Everything will be placed here</p>"
+"created_at": "2018-11-28 08:10:39"
+"updated_at": "2018-11-28 08:10:39"
+"markdown": 0
+"locked": 0
+"deleted_at": null
}
Run Code Online (Sandbox Code Playgroud)
但是在前端,当我尝试使用 diffForHumans 时,我看到了这个错误:
Call to a member function diffForHumans() on string
Run Code Online (Sandbox Code Playgroud)
这是我的前端的样子:
@foreach($discussions as $discussion)
<div class="flex">
<div class="avatar"></div>
<blockquote class="main_content">
<p class="author_created">Author …Run Code Online (Sandbox Code Playgroud) 通过以下代码,我能够获取保存在本地存储中的数据:
this.order = JSON.parse(localStorage.getItem('order'));
Run Code Online (Sandbox Code Playgroud)
现在,如果我进行console.log,则order变量如下所示:
[
{id: 1, title: 'Title 1'},
{id: 2, title: 'Title 2'},
]
Run Code Online (Sandbox Code Playgroud)
如何创建一个仅在VueJs或JavaScript中存储order数组的ID的数组?
作为最终结果,我想要一个像这样的数组:
newArray = [1,2];
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法:
for(var i = 0; i<=this.order.length; i++){
this.newArray.push(this.order[i]);
}
console.log(this.newArray);
Run Code Online (Sandbox Code Playgroud)
当我在控制台中查看时,它给我未定义的信息。
我拥有一个如下所示的数组的正确方法是什么?
newArray = [1,2];
Run Code Online (Sandbox Code Playgroud) html ×4
css ×3
laravel ×2
vuejs2 ×2
fonts ×1
javascript ×1
jquery ×1
php ×1
php-carbon ×1
wordpress ×1