Section 4 : HTML Tab – Examples

本文介绍如何利用Firebug工具检查网页元素,包括查看HTML结构、复制CSS样式及搜索特定元素的方法。通过实例演示了如何分析苹果iPod Touch网页的菜单栏设计。

Example 1.1. How to inspect the HTML element or how to figure out the structure of the web design you like

Note: I’m *NOT* encouraging people to copy the other people creative work. I’m just showing how to learn other people’s creation. Don’t get me wrong. :) If you are working in small software company, you probably might wear the multiple hats, which means you have to do coding (of course), user requirement, system design, UI design and so on. As you are not a designer, you may have some problems in designing things and not very sure about how to make things looks better.. so, you probably need to check other web designs and you need to adopt those designs to create your own one. For this fact, Firebug is the best tool for you. So, remember that it is not about copying thing. :)

Scenario ~ Let’s say you think that the menu bar of iPod Touch webpage of apple is impressive. You wanna know how the toolbar is created.

  • Open IPod Touch webpage in Mozilla Firefox.
  • Click “Inspect” button from the toolbar of Firebug console.
  • Move your cursor on the menu of the website by using mouse.
  • Click the element (menuitem) that you wanna inspect ( Note: I suggested you to select the first item of menu because it is easy to find out about the main HTML element. (Let’s say we selected “Apple icon” ))

  • (In our example, we selected the first menuitem of menu in webpage so that the related HTML element <A> tag is highlighted in “View Source” HTML panel. Don’t forget to take a look the “Style” panel at the right-side. The CSS rule that are styling to that <A> tag are shown in that panel. Then, You can easily figure out that the DIV called “global header” is the main for this menu. )
  • Select the DIV “globalheader”
  • Right-click on the element and select “Copy HTML ” from content menu.
  • Create new HTML file and pasted it within <body> tag.
  • After that, Check the CSS rule in Style panel. (In our case, “#globalheader” and “html, body, div, ul, ol, li, dl, dt, dd, h1, h2, h3, h4, h5, h6, pre, form, p, blockquote, fieldset, input” are the CSS rule that are styling to that A link. The blue link “nav.css” shows the source CSS file. Plus, the inherited CSS rules from ipod.css and base.css are also shown in “Style” panel)
  • So, copy those CSS and pasted them in your html file.You can repeat this step to find the CSS rule for each HTML element. But it took some times to grasp all CSS rules since you have to go one HTML element after another.. So, the best way would be copying all CSS rules from the source.
  • In order to copy the whole CSS rules from the source file, click the blue link “nav.css” then it will take you to “Style” panel (not the one from HTML panel) as the picture below.

    The CSS rule that you selected in the “Style” subpanel of HTML panel will be highlighted.

  • Click “Edit” button on the toolbar of “Style” panel
  • Select all CSS rules and Copy
  • then, paste them in your HTML file.
  • Copy the inherited CSS rule for body tag from base.css and paste them in your HTML file.
  • Check the images path and copy those required images also.
  • Finally, you got the great menubar that you are looking for.

Let me know if you are not very clear about those steps.. I have uploaded the sample here. [link] You can download it if you wanna take a look the sample.

Screenshot

*****

Example 1.2. “Scroll into View” and “Searching” in HTML tab.

Searching feature of HTML is useful if you wanna find something in HTML Source. (The default search of Mozilla Firefox is for searching the text. not for searching the HTML source.) Searching feature is more helpful if you use “Scroll Into View” after search. If you found something you want in HTML tab then you can click “Scroll Into View” to scroll that thing into view.

Scenario : How to find your photo in 2kbloggers Photo Montage Page?

Let’s say you are one of members of 2kbloggers team. so, your photo will be included inPhoto Montage page of 2kbloggers website. As there are too many photos in that page, it is not so easy to find yourself among those photos. The Firefox default search is useless for that case. Fortunately, The search feature of HTML panel of Firebug will help you to find your photo in very easy way.

Steps ~

  •  Launch Firebug console in that page.
  • Go to HTML Console
  • Type your blog link (eg: http://michaelsync.net) in Search textbox. (note: please type a lit bit slow and wait)
  • After you finished typing, the Anchor element which is belong to your link will be highlighted in “View Source” panel.
  • Move your cursor on the src of image link. Firebug will show the photo that you are looking for.
  • Right-click on that element and click “Scroll into View”
  • Then, check the photo at the first line under toolbar of Mozilla Firefox. Your photo will be there at the first line..

That’s all. Don’t hesitate to contact me if you have any problem for those tutorials.

Thanks for reading.

### STM32F4 UART1 DMA Transmit Receive Configuration Tutorial #### Using STM32CubeMX to Configure UART1 with DMA on the STM32F407 Development Board To configure UART1 using Direct Memory Access (DMA) for both transmission and reception, follow these guidelines: The STM32F4 series microcontrollers support multiple serial communication interfaces including USARTs that can operate in asynchronous mode. For configuring UART1 specifically with DMA capabilities, one should use STM32CubeMX software which simplifies peripheral setup through a graphical interface[^1]. For setting up UART1 with DMA functionality within STM32CubeMX: - Open STM32CubeMX. - Select the target device as `STM32F407`. - Navigate to the "Connectivity" tab where all available UART/USART peripherals are listed. - Choose `UART1` from this list. Ensure enabling of DMA streams associated with UART1's TX (transmit) and RX (receive). This involves selecting appropriate DMA requests under the NVIC settings section after expanding UART1 properties. Additionally, ensure proper pin assignments by checking GPIO configurations linked to UART1_TX and UART1_RX pins according to your hardware layout. After completing initial configuration via CubeMX, proceed into HAL library-based code generation step provided by the tool itself. Generated initialization functions will handle low-level register setups necessary for establishing functional UART-DMA links automatically when initializing system resources during startup sequence execution. Below is an example snippet demonstrating how generated C source files might look like post-generation concerning UART1_DMA_Init function calls made inside main.c or similar entry point file: ```c /* USER CODE BEGIN Includes */ #include "stm32f4xx_hal.h" /* USER CODE END Includes */ UART_HandleTypeDef huart1; DMA_HandleTypeDef hdma_usart1_tx; DMA_HandleTypeDef hdma_usart1_rx; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); /* Initializes the DMA controller channels used in the application */ static void MX_USART1_UART_Init(void); int main(void){ /* Reset of all peripherals, Initializes the Flash interface and Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); // Call before any other init routines requiring DMA services MX_USART1_UART_Init(); while(1){ // Application loop here... } } ``` This approach ensures seamless integration between UART operations and direct memory access mechanisms without manual intervention at assembly level programming stages typically required otherwise for such tasks involving complex interactions among different subsystem components present onboard selected MCU models partaking in STMicroelectronics' ARM Cortex-M family lineup. --related questions-- 1. What specific steps must be taken outside of STM32CubeMX once it has been utilized to set up UART1? 2. How does one verify correct operation of UART1 alongside its connected DMA channel(s)? 3. Can you provide examples illustrating common pitfalls encountered while implementing UART communications utilizing DMA features? 4. In what scenarios would disabling/enabling interrupts related to either UART or DMA prove beneficial during development processes centered around embedded systems based upon STM32 platforms?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值