Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Myteam
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yulong Wang
Myteam
Commits
69f075e0
Commit
69f075e0
authored
6 months ago
by
Yulong Wang
Browse files
Options
Downloads
Patches
Plain Diff
Delete main.css
parent
08e2a1dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercise/main.css
+0
-23
0 additions, 23 deletions
exercise/main.css
with
0 additions
and
23 deletions
exercise/main.css
deleted
100644 → 0
+
0
−
23
View file @
08e2a1dd
.header
{
/*设置容器的大小,然后让容器内的图片不会超出去*/
border-color
:
black
;
/*可视化边框范围用*/
border-style
:
solid
;
width
:
100%
;
height
:
120px
;
overflow
:
hidden
;
/*图片超出容器的部分隐藏掉 */
position
:
relative
;
/*这个postion是用于规范,因为img的header的子类,子类的position写的absolute是相对于父类的absolute,规范写法需要加上*/
}
/*将图片按照容器的大小进行适配,统一高度并居中*/
.header
img
{
height
:
120px
;
position
:
absolute
;
/*设置图片是绝对位置,并且是绝对是从容器的左一半的位置开始显示*/
left
:
50%
;
transform
:
translateX
(
-50%
);
transform是移动属性,X轴移动-50%
也就是向左移动一半的距离,这样就一定是居中显示的图片
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment